Refine ASN.1 functions

This commit is contained in:
Zhi Guan
2023-01-14 19:07:03 +08:00
parent e54b4ae182
commit b858b01d39
7 changed files with 1173 additions and 847 deletions

View File

@@ -345,10 +345,10 @@ int x509_rdn_to_der(int oid, int tag, const uint8_t *val, size_t vlen,
{
size_t len = 0;
if (x509_attr_type_and_value_to_der(oid, tag, val, vlen, NULL, &len) != 1
|| asn1_data_to_der(more, morelen, NULL, &len) < 0
|| asn1_any_to_der(more, morelen, NULL, &len) < 0
|| asn1_set_header_to_der(len, out, outlen) != 1
|| x509_attr_type_and_value_to_der(oid, tag, val, vlen, out, outlen) != 1
|| asn1_data_to_der(more, morelen, out, outlen) < 0) {
|| asn1_any_to_der(more, morelen, out, outlen) < 0) {
error_print();
return -1;
}