diff options
author | tb <> | 2018-05-18 19:34:37 +0000 |
---|---|---|
committer | tb <> | 2018-05-18 19:34:37 +0000 |
commit | 7ee7ac4092a33201af1ca59a68f151926c3bef0c (patch) | |
tree | f2b19a68eb45061d92619f9561893c37fa189705 /src/lib/libcrypto/x509v3/v3_conf.c | |
parent | 3837f48e35529be04679788d486c2082b24cfa6b (diff) | |
download | openbsd-7ee7ac4092a33201af1ca59a68f151926c3bef0c.tar.gz openbsd-7ee7ac4092a33201af1ca59a68f151926c3bef0c.tar.bz2 openbsd-7ee7ac4092a33201af1ca59a68f151926c3bef0c.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_conf.c')
-rw-r--r-- | src/lib/libcrypto/x509v3/v3_conf.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_conf.c b/src/lib/libcrypto/x509v3/v3_conf.c index bb06c18536..78ff19808b 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.22 2018/05/13 17:49:02 tb Exp $ */ | 1 | /* $OpenBSD: v3_conf.c,v 1.23 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 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -411,27 +411,23 @@ X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section, | |||
411 | /* Config database functions */ | 411 | /* Config database functions */ |
412 | 412 | ||
413 | char * | 413 | char * |
414 | X509V3_get_string(X509V3_CTX *ctx, char *name, char *section) | 414 | X509V3_get_string(X509V3_CTX *ctx, const char *name, const char *section) |
415 | { | 415 | { |
416 | if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_string) { | 416 | if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_string) { |
417 | X509V3error(X509V3_R_OPERATION_NOT_DEFINED); | 417 | X509V3error(X509V3_R_OPERATION_NOT_DEFINED); |
418 | return NULL; | 418 | return NULL; |
419 | } | 419 | } |
420 | if (ctx->db_meth->get_string) | 420 | return ctx->db_meth->get_string(ctx->db, name, section); |
421 | return ctx->db_meth->get_string(ctx->db, name, section); | ||
422 | return NULL; | ||
423 | } | 421 | } |
424 | 422 | ||
425 | STACK_OF(CONF_VALUE) * | 423 | STACK_OF(CONF_VALUE) * |
426 | X509V3_get_section(X509V3_CTX *ctx, char *section) | 424 | X509V3_get_section(X509V3_CTX *ctx, const char *section) |
427 | { | 425 | { |
428 | if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_section) { | 426 | if (!ctx->db || !ctx->db_meth || !ctx->db_meth->get_section) { |
429 | X509V3error(X509V3_R_OPERATION_NOT_DEFINED); | 427 | X509V3error(X509V3_R_OPERATION_NOT_DEFINED); |
430 | return NULL; | 428 | return NULL; |
431 | } | 429 | } |
432 | if (ctx->db_meth->get_section) | 430 | return ctx->db_meth->get_section(ctx->db, section); |
433 | return ctx->db_meth->get_section(ctx->db, section); | ||
434 | return NULL; | ||
435 | } | 431 | } |
436 | 432 | ||
437 | void | 433 | void |