diff options
author | beck <> | 2014-04-26 18:56:38 +0000 |
---|---|---|
committer | beck <> | 2014-04-26 18:56:38 +0000 |
commit | e7dbd7a1e2ad3e12dafa2919bc8603d60416ea4d (patch) | |
tree | dff54039de6c4454b05953e2ce78edfc5693e6b5 /src/lib/libcrypto/x509v3/v3_alt.c | |
parent | a1c73b72875dcb25545f111b3779cf0f0ebf9c88 (diff) | |
download | openbsd-e7dbd7a1e2ad3e12dafa2919bc8603d60416ea4d.tar.gz openbsd-e7dbd7a1e2ad3e12dafa2919bc8603d60416ea4d.tar.bz2 openbsd-e7dbd7a1e2ad3e12dafa2919bc8603d60416ea4d.zip |
Replace all use of ERR_add_error_data with ERR_asprintf_error_data.
This avoids a lot of ugly gymnastics to do snprintfs before sending the
bag of strings to ERR, and eliminates at least one place in dso_dlfctn.c
where it was being called with the incorrect number of arguments and
using random things off the stack as addresses of strings.
ok krw@, jsing@
Diffstat (limited to 'src/lib/libcrypto/x509v3/v3_alt.c')
-rw-r--r-- | src/lib/libcrypto/x509v3/v3_alt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_alt.c b/src/lib/libcrypto/x509v3/v3_alt.c index e61ed673c0..61b0c90fad 100644 --- a/src/lib/libcrypto/x509v3/v3_alt.c +++ b/src/lib/libcrypto/x509v3/v3_alt.c | |||
@@ -479,7 +479,7 @@ a2i_GENERAL_NAME(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | |||
479 | if (!(obj = OBJ_txt2obj(value, 0))) { | 479 | if (!(obj = OBJ_txt2obj(value, 0))) { |
480 | X509V3err(X509V3_F_A2I_GENERAL_NAME, | 480 | X509V3err(X509V3_F_A2I_GENERAL_NAME, |
481 | X509V3_R_BAD_OBJECT); | 481 | X509V3_R_BAD_OBJECT); |
482 | ERR_add_error_data(2, "value=", value); | 482 | ERR_asprintf_error_data("value=%s", value); |
483 | goto err; | 483 | goto err; |
484 | } | 484 | } |
485 | gen->d.rid = obj; | 485 | gen->d.rid = obj; |
@@ -494,7 +494,7 @@ a2i_GENERAL_NAME(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | |||
494 | if (gen->d.ip == NULL) { | 494 | if (gen->d.ip == NULL) { |
495 | X509V3err(X509V3_F_A2I_GENERAL_NAME, | 495 | X509V3err(X509V3_F_A2I_GENERAL_NAME, |
496 | X509V3_R_BAD_IP_ADDRESS); | 496 | X509V3_R_BAD_IP_ADDRESS); |
497 | ERR_add_error_data(2, "value=", value); | 497 | ERR_asprintf_error_data("value=%s", value); |
498 | goto err; | 498 | goto err; |
499 | } | 499 | } |
500 | break; | 500 | break; |
@@ -572,7 +572,7 @@ v2i_GENERAL_NAME_ex(GENERAL_NAME *out, const X509V3_EXT_METHOD *method, | |||
572 | else { | 572 | else { |
573 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX, | 573 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX, |
574 | X509V3_R_UNSUPPORTED_OPTION); | 574 | X509V3_R_UNSUPPORTED_OPTION); |
575 | ERR_add_error_data(2, "name=", name); | 575 | ERR_asprintf_error_data("name=%s", name); |
576 | return NULL; | 576 | return NULL; |
577 | } | 577 | } |
578 | 578 | ||
@@ -620,7 +620,7 @@ do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) | |||
620 | sk = X509V3_get_section(ctx, value); | 620 | sk = X509V3_get_section(ctx, value); |
621 | if (!sk) { | 621 | if (!sk) { |
622 | X509V3err(X509V3_F_DO_DIRNAME, X509V3_R_SECTION_NOT_FOUND); | 622 | X509V3err(X509V3_F_DO_DIRNAME, X509V3_R_SECTION_NOT_FOUND); |
623 | ERR_add_error_data(2, "section=", value); | 623 | ERR_asprintf_error_data("section=%s", value); |
624 | X509_NAME_free(nm); | 624 | X509_NAME_free(nm); |
625 | return 0; | 625 | return 0; |
626 | } | 626 | } |