diff options
author | beck <> | 2015-12-14 03:39:14 +0000 |
---|---|---|
committer | beck <> | 2015-12-14 03:39:14 +0000 |
commit | f9a93df50ef815acfe85719ca87ec7a2e02d3fb6 (patch) | |
tree | ae28ed08fc1f01335c7c2a45a2d5747d10dbb0ca /src | |
parent | eba08ab4aff1bdbd5e9dac35c411aeb69567ff42 (diff) | |
download | openbsd-f9a93df50ef815acfe85719ca87ec7a2e02d3fb6.tar.gz openbsd-f9a93df50ef815acfe85719ca87ec7a2e02d3fb6.tar.bz2 openbsd-f9a93df50ef815acfe85719ca87ec7a2e02d3fb6.zip |
initialize ext_len to 0.
ok guenther@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/x509v3/v3_conf.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/x509v3/v3_conf.c | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_conf.c b/src/lib/libcrypto/x509v3/v3_conf.c index 37834813c7..20e156ce87 100644 --- a/src/lib/libcrypto/x509v3/v3_conf.c +++ b/src/lib/libcrypto/x509v3/v3_conf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: v3_conf.c,v 1.18 2015/09/30 18:41:06 jsing Exp $ */ | 1 | /* $OpenBSD: v3_conf.c,v 1.19 2015/12/14 03:39:14 beck 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 | */ |
@@ -278,7 +278,7 @@ v3_generic_extension(const char *ext, char *value, int crit, int gen_type, | |||
278 | X509V3_CTX *ctx) | 278 | X509V3_CTX *ctx) |
279 | { | 279 | { |
280 | unsigned char *ext_der = NULL; | 280 | unsigned char *ext_der = NULL; |
281 | long ext_len; | 281 | long ext_len = 0; |
282 | ASN1_OBJECT *obj = NULL; | 282 | ASN1_OBJECT *obj = NULL; |
283 | ASN1_OCTET_STRING *oct = NULL; | 283 | ASN1_OCTET_STRING *oct = NULL; |
284 | X509_EXTENSION *extension = NULL; | 284 | X509_EXTENSION *extension = NULL; |
@@ -294,6 +294,10 @@ v3_generic_extension(const char *ext, char *value, int crit, int gen_type, | |||
294 | ext_der = string_to_hex(value, &ext_len); | 294 | ext_der = string_to_hex(value, &ext_len); |
295 | else if (gen_type == 2) | 295 | else if (gen_type == 2) |
296 | ext_der = generic_asn1(value, ctx, &ext_len); | 296 | ext_der = generic_asn1(value, ctx, &ext_len); |
297 | else { | ||
298 | ERR_asprintf_error_data("Unexpected generic extension type %d", gen_type); | ||
299 | goto err; | ||
300 | } | ||
297 | 301 | ||
298 | if (ext_der == NULL) { | 302 | if (ext_der == NULL) { |
299 | X509V3err(X509V3_F_V3_GENERIC_EXTENSION, | 303 | X509V3err(X509V3_F_V3_GENERIC_EXTENSION, |
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_conf.c b/src/lib/libssl/src/crypto/x509v3/v3_conf.c index 37834813c7..20e156ce87 100644 --- a/src/lib/libssl/src/crypto/x509v3/v3_conf.c +++ b/src/lib/libssl/src/crypto/x509v3/v3_conf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: v3_conf.c,v 1.18 2015/09/30 18:41:06 jsing Exp $ */ | 1 | /* $OpenBSD: v3_conf.c,v 1.19 2015/12/14 03:39:14 beck 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 | */ |
@@ -278,7 +278,7 @@ v3_generic_extension(const char *ext, char *value, int crit, int gen_type, | |||
278 | X509V3_CTX *ctx) | 278 | X509V3_CTX *ctx) |
279 | { | 279 | { |
280 | unsigned char *ext_der = NULL; | 280 | unsigned char *ext_der = NULL; |
281 | long ext_len; | 281 | long ext_len = 0; |
282 | ASN1_OBJECT *obj = NULL; | 282 | ASN1_OBJECT *obj = NULL; |
283 | ASN1_OCTET_STRING *oct = NULL; | 283 | ASN1_OCTET_STRING *oct = NULL; |
284 | X509_EXTENSION *extension = NULL; | 284 | X509_EXTENSION *extension = NULL; |
@@ -294,6 +294,10 @@ v3_generic_extension(const char *ext, char *value, int crit, int gen_type, | |||
294 | ext_der = string_to_hex(value, &ext_len); | 294 | ext_der = string_to_hex(value, &ext_len); |
295 | else if (gen_type == 2) | 295 | else if (gen_type == 2) |
296 | ext_der = generic_asn1(value, ctx, &ext_len); | 296 | ext_der = generic_asn1(value, ctx, &ext_len); |
297 | else { | ||
298 | ERR_asprintf_error_data("Unexpected generic extension type %d", gen_type); | ||
299 | goto err; | ||
300 | } | ||
297 | 301 | ||
298 | if (ext_der == NULL) { | 302 | if (ext_der == NULL) { |
299 | X509V3err(X509V3_F_V3_GENERIC_EXTENSION, | 303 | X509V3err(X509V3_F_V3_GENERIC_EXTENSION, |