shithub: riscv

Download patch

ref: 0339e9ac44b4aed285391727ce3d6e3e1afd173e
parent: e9aed242ccf6c569491b34e5455e9ea9b78cd29a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Jun 20 20:38:06 EDT 2021

libsec: restore old behaviour for generating self signed cert

--- a/sys/src/libsec/port/x509.c
+++ b/sys/src/libsec/port/x509.c
@@ -2658,6 +2658,10 @@
 				mkel(mkoid((Ints*)&oid_extensionRequest),
 				mkel(mkset(xl), nil))), nil);
 	}
+	if(req)
+		xl = mkel(mkcont(0, xl), nil);
+	else if(xl != nil)
+		xl = mkel(mkcont(3, xl), nil);
 	return xl;
 }
 
@@ -2777,7 +2781,7 @@
 			mkel(mkalg(ALG_rsaEncryption),
 			mkel(mkbits(pkbytes->data, pkbytes->len),
 			nil))),
-		mkel(mkcont(3, mkextensions(alts, 0)), nil)))))))));
+		mkextensions(alts, 0)))))))));
 	freebytes(pkbytes);
 	if(encode(e, &certinfobytes) != ASN_OK)
 		goto errret;
@@ -2843,7 +2847,7 @@
 			mkel(mkalg(ALG_rsaEncryption),
 			mkel(mkbits(pkbytes->data, pkbytes->len),
 			nil))),
-		mkel(mkcont(0, mkextensions(alts, 1)), nil)))));
+		mkextensions(alts, 1)))));
 	freebytes(pkbytes);
 	if(encode(e, &certinfobytes) != ASN_OK)
 		goto errret;