git: 9front

Download patch

ref: 7faec11b297b60e0f034685370c0ff17a458177a
parent: 9397feb7c25bda981ebbda1de391ff449c19c860
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Jul 16 18:08:54 EDT 2025

libsec: allow missing subject

certificates appear to now omit the subject field
completely, relying only on subject alternative name
extension instead.

so do not fail decode_cert() if the subject name
is missing.

copysubject() and appendaltname() will handle it.

--- a/sys/src/libsec/port/x509.c
+++ b/sys/src/libsec/port/x509.c
@@ -1943,8 +1943,6 @@
 
 	/* resume CertificateInfo */
  	c->subject = parse_name(esubj);
-	if(c->subject == nil)
-		goto errret;
 
 	/* SubjectPublicKeyInfo */
 	if(!is_seq(epubkey, &elpubkey))
@@ -3089,8 +3087,6 @@
 		goto errret;
  	el = el->tl;
 	subject = parse_name(&el->hd);
-	if(subject == nil)
-		goto errret;
 	copysubject(name, nname, subject);
 	free(subject);
 	el = el->tl;
--