Update X509

This commit is contained in:
Zhi Guan
2023-02-04 23:21:01 +08:00
parent 6a02a61c4f
commit 1abbd54bb8
11 changed files with 268 additions and 302 deletions

View File

@@ -83,6 +83,7 @@ int reqgen_main(int argc, char **argv)
char *outfile = NULL;
FILE *outfp = stdout;
uint8_t req[1024];
uint8_t *p = req;
size_t reqlen = 0;
argc--;
@@ -198,13 +199,14 @@ bad:
goto end;
}
if (x509_req_sign(req, &reqlen, sizeof(req),
if (x509_req_sign_to_der(
X509_version_v1,
name, namelen,
&sm2_key,
NULL, 0,
OID_sm2sign_with_sm3,
&sm2_key, signer_id, signer_id_len) != 1) {
&sm2_key, signer_id, signer_id_len,
&p, &reqlen) != 1) {
fprintf(stderr, "%s: inner error\n", prog);
goto end;
}