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/engine | |
| 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/engine')
| -rw-r--r-- | src/lib/libcrypto/engine/eng_cnf.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/engine/eng_fat.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/engine/eng_list.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/engine/eng_cnf.c b/src/lib/libcrypto/engine/eng_cnf.c index 95c4070015..afb704e93b 100644 --- a/src/lib/libcrypto/engine/eng_cnf.c +++ b/src/lib/libcrypto/engine/eng_cnf.c | |||
| @@ -203,9 +203,9 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf) | |||
| 203 | { | 203 | { |
| 204 | ENGINEerr(ENGINE_F_INT_ENGINE_CONFIGURE, ENGINE_R_ENGINE_CONFIGURATION_ERROR); | 204 | ENGINEerr(ENGINE_F_INT_ENGINE_CONFIGURE, ENGINE_R_ENGINE_CONFIGURATION_ERROR); |
| 205 | if (ecmd) | 205 | if (ecmd) |
| 206 | ERR_add_error_data(6, "section=", ecmd->section, | 206 | ERR_asprintf_error_data |
| 207 | ", name=", ecmd->name, | 207 | ("section=%s, name=%s, value=%s", |
| 208 | ", value=", ecmd->value); | 208 | ecmd->section, ecmd->name, ecmd->value); |
| 209 | } | 209 | } |
| 210 | if (e) | 210 | if (e) |
| 211 | ENGINE_free(e); | 211 | ENGINE_free(e); |
diff --git a/src/lib/libcrypto/engine/eng_fat.c b/src/lib/libcrypto/engine/eng_fat.c index 789b8d57e5..e01067566e 100644 --- a/src/lib/libcrypto/engine/eng_fat.c +++ b/src/lib/libcrypto/engine/eng_fat.c | |||
| @@ -141,7 +141,7 @@ int ENGINE_set_default_string(ENGINE *e, const char *def_list) | |||
| 141 | { | 141 | { |
| 142 | ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_STRING, | 142 | ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_STRING, |
| 143 | ENGINE_R_INVALID_STRING); | 143 | ENGINE_R_INVALID_STRING); |
| 144 | ERR_add_error_data(2, "str=",def_list); | 144 | ERR_asprintf_error_data("str=%s",def_list); |
| 145 | return 0; | 145 | return 0; |
| 146 | } | 146 | } |
| 147 | return ENGINE_set_default(e, flags); | 147 | return ENGINE_set_default(e, flags); |
diff --git a/src/lib/libcrypto/engine/eng_list.c b/src/lib/libcrypto/engine/eng_list.c index 95c858960b..5528b5478f 100644 --- a/src/lib/libcrypto/engine/eng_list.c +++ b/src/lib/libcrypto/engine/eng_list.c | |||
| @@ -389,7 +389,7 @@ ENGINE *ENGINE_by_id(const char *id) | |||
| 389 | { | 389 | { |
| 390 | ENGINEerr(ENGINE_F_ENGINE_BY_ID, | 390 | ENGINEerr(ENGINE_F_ENGINE_BY_ID, |
| 391 | ENGINE_R_NO_SUCH_ENGINE); | 391 | ENGINE_R_NO_SUCH_ENGINE); |
| 392 | ERR_add_error_data(2, "id=", id); | 392 | ERR_asprintf_error_data("id=%s", id); |
| 393 | } | 393 | } |
| 394 | return iterator; | 394 | return iterator; |
| 395 | #else | 395 | #else |
| @@ -416,7 +416,7 @@ ENGINE *ENGINE_by_id(const char *id) | |||
| 416 | notfound: | 416 | notfound: |
| 417 | ENGINE_free(iterator); | 417 | ENGINE_free(iterator); |
| 418 | ENGINEerr(ENGINE_F_ENGINE_BY_ID,ENGINE_R_NO_SUCH_ENGINE); | 418 | ENGINEerr(ENGINE_F_ENGINE_BY_ID,ENGINE_R_NO_SUCH_ENGINE); |
| 419 | ERR_add_error_data(2, "id=", id); | 419 | ERR_asprintf_error_data("id=%s", id); |
| 420 | return NULL; | 420 | return NULL; |
| 421 | /* EEK! Experimental code ends */ | 421 | /* EEK! Experimental code ends */ |
| 422 | #endif | 422 | #endif |
