pull/87/merge
aerth 5 years ago committed by GitHub
commit 022e627a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,17 +1,9 @@
#!/bin/bash
set -eu -o pipefail
shopt -s failglob
cp -a $(go env GOROOT)/src/crypto/x509/* ./
rm ./x509_test.go
# The following code is utterly horrifying. I can't find a better way to do it. :(
mkdir -p ${GOPATH}/src/vendor/golang.org/
cp -R $(go env GOROOT)/src/vendor/golang_org/* ${GOPATH}/src/vendor/golang.org/
# h/t to https://www.cyberciti.biz/faq/unix-linux-replace-string-words-in-many-files/
OLD_PACKAGE='"golang_org/x/crypto/cryptobyte'
OLD_PACKAGE="${OLD_PACKAGE//\//\\/}"
NEW_PACKAGE='"golang.org/x/crypto/cryptobyte'
NEW_PACKAGE="${NEW_PACKAGE//\//\\/}"
sed -i "s/${OLD_PACKAGE}/${NEW_PACKAGE}/g" ./*.go ${GOPATH}/src/vendor/golang.org/x/crypto/cryptobyte/*.go
#!/bin/sh
set -e
goroot="$(go env GOROOT)"
x509path=$goroot/src/crypto/x509
test -d $goroot
test -d $x509path
cp -av $x509path/* .
rm x509_test.go
sed -i.bak 's/golang_org/golang.org/g' x509.go

@ -9,7 +9,7 @@
// Last rebased on Go 1.10
// Remove all content between "import" and "CreateCertificate" in original.
// Remove all content after "CreateCertificate" in original.
//go:generate bash install.sh
//go:generate sh install.sh
// Package x509 parses X.509-encoded keys and certificates.
//
@ -20,30 +20,11 @@ package x509
import (
"bytes"
//"crypto"
//"crypto/dsa"
//"crypto/ecdsa"
//"crypto/elliptic"
//"crypto/rsa"
_ "crypto/sha1"
_ "crypto/sha256"
_ "crypto/sha512"
//"crypto/x509/pkix"
"encoding/asn1"
//"encoding/pem"
"errors"
//"fmt"
//"io"
//"math/big"
//"net"
//"net/url"
//"strconv"
//"strings"
//"time"
//"unicode/utf8"
//
//"golang_org/x/crypto/cryptobyte"
//cryptobyte_asn1 "golang_org/x/crypto/cryptobyte/asn1"
)
// CreateCertificate creates a new X.509v3 certificate based on a template.

Loading…
Cancel
Save