diff options
Diffstat (limited to 'libgo/go/crypto/x509/x509.go')
-rw-r--r-- | libgo/go/crypto/x509/x509.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libgo/go/crypto/x509/x509.go b/libgo/go/crypto/x509/x509.go index 7e6b5c96f53..65ca3158003 100644 --- a/libgo/go/crypto/x509/x509.go +++ b/libgo/go/crypto/x509/x509.go @@ -927,10 +927,15 @@ func CreateCertificate(rand io.Reader, template, parent *Certificate, pub *rsa.P return } - asn1Issuer, err := asn1.Marshal(parent.Subject.ToRDNSequence()) - if err != nil { - return + var asn1Issuer []byte + if len(parent.RawSubject) > 0 { + asn1Issuer = parent.RawSubject + } else { + if asn1Issuer, err = asn1.Marshal(parent.Subject.ToRDNSequence()); err != nil { + return + } } + asn1Subject, err := asn1.Marshal(template.Subject.ToRDNSequence()) if err != nil { return |