summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2024-06-18 09:47:03 +0000
committertb <>2024-06-18 09:47:03 +0000
commit680fe710dc4d18bbc793df16e3c196f4a2141e0b (patch)
tree44593162523f853a73b7b9fdf4a75e1b7c9b3b67 /src/lib
parentb16993b68ead4bf2467c39ab91fc6770abb3f186 (diff)
downloadopenbsd-680fe710dc4d18bbc793df16e3c196f4a2141e0b.tar.gz
openbsd-680fe710dc4d18bbc793df16e3c196f4a2141e0b.tar.bz2
openbsd-680fe710dc4d18bbc793df16e3c196f4a2141e0b.zip
v3_generic_extension() use ASN1_STRING_set0()
This aligns it with do_ext_i2d()
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/x509/x509_conf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509/x509_conf.c b/src/lib/libcrypto/x509/x509_conf.c
index 31cff79e62..a9e5076dc9 100644
--- a/src/lib/libcrypto/x509/x509_conf.c
+++ b/src/lib/libcrypto/x509/x509_conf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_conf.c,v 1.16 2024/06/18 09:41:33 tb Exp $ */ 1/* $OpenBSD: x509_conf.c,v 1.17 2024/06/18 09:47:03 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -314,14 +314,14 @@ v3_generic_extension(const char *name, const char *value, int crit, int gen_type
314 goto err; 314 goto err;
315 } 315 }
316 316
317 if (!(oct = ASN1_OCTET_STRING_new())) { 317 if ((oct = ASN1_OCTET_STRING_new()) == NULL) {
318 X509V3error(ERR_R_MALLOC_FAILURE); 318 X509V3error(ERR_R_MALLOC_FAILURE);
319 goto err; 319 goto err;
320 } 320 }
321 321
322 oct->data = ext_der; 322 ASN1_STRING_set0(oct, ext_der, ext_len);
323 oct->length = ext_len;
324 ext_der = NULL; 323 ext_der = NULL;
324 ext_len = 0;
325 325
326 ext = X509_EXTENSION_create_by_OBJ(NULL, obj, crit, oct); 326 ext = X509_EXTENSION_create_by_OBJ(NULL, obj, crit, oct);
327 327