diff options
author | tb <> | 2018-05-18 19:34:37 +0000 |
---|---|---|
committer | tb <> | 2018-05-18 19:34:37 +0000 |
commit | 634ba320528daa064590229749a91b1740c31c1c (patch) | |
tree | f2b19a68eb45061d92619f9561893c37fa189705 /src/lib/libcrypto/x509v3/v3_alt.c | |
parent | 8f0380c45f6d68d154c00d69c95ab79609a0cd2d (diff) | |
download | openbsd-634ba320528daa064590229749a91b1740c31c1c.tar.gz openbsd-634ba320528daa064590229749a91b1740c31c1c.tar.bz2 openbsd-634ba320528daa064590229749a91b1740c31c1c.zip |
The 'name', 'value' and 'section' arguments for a2i_GENERAL_NAME(),
X509V3_get_value_bool(), X509V3_add_value_bool_nf(),
X509V3_get_value_int(), X509V3_get_string(), X509V3_get_section()
are now const.
While there, remove a stupid cast and two redundant checks.
tested in a bulk build by sthen
ok jsing
Diffstat (limited to 'src/lib/libcrypto/x509v3/v3_alt.c')
-rw-r--r-- | src/lib/libcrypto/x509v3/v3_alt.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_alt.c b/src/lib/libcrypto/x509v3/v3_alt.c index 746339bebd..08063d191b 100644 --- a/src/lib/libcrypto/x509v3/v3_alt.c +++ b/src/lib/libcrypto/x509v3/v3_alt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: v3_alt.c,v 1.27 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: v3_alt.c,v 1.28 2018/05/18 19:34:37 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. | 3 | * project. |
4 | */ | 4 | */ |
@@ -69,8 +69,8 @@ static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, | |||
69 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); | 69 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); |
70 | static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p); | 70 | static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p); |
71 | static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens); | 71 | static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens); |
72 | static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx); | 72 | static int do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx); |
73 | static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx); | 73 | static int do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx); |
74 | 74 | ||
75 | const X509V3_EXT_METHOD v3_alt[] = { | 75 | const X509V3_EXT_METHOD v3_alt[] = { |
76 | { | 76 | { |
@@ -481,7 +481,7 @@ v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, | |||
481 | 481 | ||
482 | GENERAL_NAME * | 482 | GENERAL_NAME * |
483 | a2i_GENERAL_NAME(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | 483 | a2i_GENERAL_NAME(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, |
484 | X509V3_CTX *ctx, int gen_type, char *value, int is_nc) | 484 | X509V3_CTX *ctx, int gen_type, const char *value, int is_nc) |
485 | { | 485 | { |
486 | char is_string = 0; | 486 | char is_string = 0; |
487 | GENERAL_NAME *gen = NULL; | 487 | GENERAL_NAME *gen = NULL; |
@@ -553,8 +553,7 @@ a2i_GENERAL_NAME(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | |||
553 | 553 | ||
554 | if (is_string) { | 554 | if (is_string) { |
555 | if (!(gen->d.ia5 = ASN1_IA5STRING_new()) || | 555 | if (!(gen->d.ia5 = ASN1_IA5STRING_new()) || |
556 | !ASN1_STRING_set(gen->d.ia5, (unsigned char*)value, | 556 | !ASN1_STRING_set(gen->d.ia5, value, strlen(value))) { |
557 | strlen(value))) { | ||
558 | X509V3error(ERR_R_MALLOC_FAILURE); | 557 | X509V3error(ERR_R_MALLOC_FAILURE); |
559 | goto err; | 558 | goto err; |
560 | } | 559 | } |
@@ -609,7 +608,7 @@ v2i_GENERAL_NAME_ex(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | |||
609 | } | 608 | } |
610 | 609 | ||
611 | static int | 610 | static int |
612 | do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) | 611 | do_othername(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx) |
613 | { | 612 | { |
614 | char *objtmp = NULL, *p; | 613 | char *objtmp = NULL, *p; |
615 | int objlen; | 614 | int objlen; |
@@ -638,7 +637,7 @@ do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) | |||
638 | } | 637 | } |
639 | 638 | ||
640 | static int | 639 | static int |
641 | do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) | 640 | do_dirname(GENERAL_NAME *gen, const char *value, X509V3_CTX *ctx) |
642 | { | 641 | { |
643 | int ret; | 642 | int ret; |
644 | STACK_OF(CONF_VALUE) *sk; | 643 | STACK_OF(CONF_VALUE) *sk; |