hx509: PKCS#12 missing error check

This commit is contained in:
Nicolas Williams
2022-11-20 00:30:13 -06:00
committed by Jeffrey Altman
parent cce8ae9927
commit 0d5b238186
2 changed files with 36 additions and 8 deletions

View File

@@ -91,14 +91,14 @@ keyBag_parser(hx509_context context,
if (ret)
return ret;
_hx509_collector_private_key_add(context,
c,
&ki.privateKeyAlgorithm,
NULL,
&ki.privateKey,
os);
ret = _hx509_collector_private_key_add(context,
c,
&ki.privateKeyAlgorithm,
NULL,
&ki.privateKey,
os);
free_PKCS8PrivateKeyInfo(&ki);
return 0;
return ret;
}
static int

View File

@@ -131,5 +131,33 @@ Certificate Request:
email:foo@test.h5l.se, DNS:nutcracker.test.h5l.se, DNS:foo.nutcracker.test.h5l.se, othername:<unsupported>, othername:<unsupported>, Registered ID:1.2.3.4.5.6.9
Signature Algorithm: sha256WithRSAEncryption
EOF
diff -w "${objdir}/expected" "${objdir}/actual" || exit 1
if ! diff -u -w "${objdir}/expected" "${objdir}/actual"; then
cat > "$objdir/expected" <<EOF
Certificate Request:
Data:
Version: $v (0x0)
Subject: DC = se, DC = su, DC = it, CN = Love
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
${k}Public-Key: (1024 bit)
Modulus:
00:c2:aa:a2:42:b7:5b:99:a3:fd:ba:f0:9b:75:db:
ef:3c:9b:8c:cf:63:5f:46:d8:95:be:09:4a:a7:76:
79:77:61:30:ef:0b:98:d2:47:ea:9c:09:b9:b9:b7:
15:ac:4b:9c:2d:3f:f0:d9:99:9d:4d:5a:68:67:24:
58:5e:65:60:13:9f:4d:dc:2f:03:1d:cd:e9:b6:33:
c2:5c:c6:de:c9:93:6c:ec:8d:9a:67:0e:dd:31:20:
ac:91:39:7a:c1:8f:39:65:ff:b3:1f:cf:7a:aa:79:
8b:ed:eb:ad:a0:be:01:10:4c:5a:a7:47:1d:c6:ee:
79:39:5c:c7:11:6c:b9:e7:2b
Exponent: 65537 (0x10001)
Attributes:
Requested Extensions:
X509v3 Extended Key Usage: critical
1.2.3.4.5.6.7, 1.2.3.4.5.6.8, 1.2.3.4.5.6.10
X509v3 Subject Alternative Name:
email:foo@test.h5l.se, DNS:nutcracker.test.h5l.se, DNS:foo.nutcracker.test.h5l.se, othername: 1.3.6.1.5.2.2::<unsupported>, othername: 1.3.6.1.5.2.2::<unsupported>, Registered ID:1.2.3.4.5.6.9
Signature Algorithm: sha256WithRSAEncryption
EOF
fi
fi