Fix REQ format bug

Attributes not OPTIONAL
This commit is contained in:
Zhi Guan
2023-02-06 17:07:08 +08:00
parent 97e33d4b9a
commit 8a62b91da9
5 changed files with 13 additions and 42 deletions

View File

@@ -72,6 +72,10 @@ int reqgen_main(int argc, char **argv)
char *org_unit = NULL;
char *common_name = NULL;
// Attributs
uint8_t attrs[512];
size_t attrs_len = 0;
// Private Key
FILE *keyfp = NULL;
char *pass = NULL;
@@ -203,7 +207,7 @@ bad:
X509_version_v1,
name, namelen,
&sm2_key,
NULL, 0,
attrs, attrs_len,
OID_sm2sign_with_sm3,
&sm2_key, signer_id, signer_id_len,
&p, &reqlen) != 1) {