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/ts | |
| 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/ts')
| -rw-r--r-- | src/lib/libcrypto/ts/ts_conf.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/ts/ts_rsp_verify.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/ts/ts_conf.c b/src/lib/libcrypto/ts/ts_conf.c index f8cf3b514c..12cce16bc8 100644 --- a/src/lib/libcrypto/ts/ts_conf.c +++ b/src/lib/libcrypto/ts/ts_conf.c | |||
| @@ -239,7 +239,7 @@ err: | |||
| 239 | if (!ret) { | 239 | if (!ret) { |
| 240 | TSerr(TS_F_TS_CONF_SET_DEFAULT_ENGINE, | 240 | TSerr(TS_F_TS_CONF_SET_DEFAULT_ENGINE, |
| 241 | TS_R_COULD_NOT_SET_ENGINE); | 241 | TS_R_COULD_NOT_SET_ENGINE); |
| 242 | ERR_add_error_data(2, "engine:", name); | 242 | ERR_asprintf_error_data("engine:%s", name); |
| 243 | } | 243 | } |
| 244 | if (e) | 244 | if (e) |
| 245 | ENGINE_free(e); | 245 | ENGINE_free(e); |
diff --git a/src/lib/libcrypto/ts/ts_rsp_verify.c b/src/lib/libcrypto/ts/ts_rsp_verify.c index 66e35dab3a..2a4c0c5ef9 100644 --- a/src/lib/libcrypto/ts/ts_rsp_verify.c +++ b/src/lib/libcrypto/ts/ts_rsp_verify.c | |||
| @@ -244,7 +244,7 @@ TS_verify_cert(X509_STORE *store, STACK_OF(X509) *untrusted, X509 *signer, | |||
| 244 | if (i <= 0) { | 244 | if (i <= 0) { |
| 245 | int j = X509_STORE_CTX_get_error(&cert_ctx); | 245 | int j = X509_STORE_CTX_get_error(&cert_ctx); |
| 246 | TSerr(TS_F_TS_VERIFY_CERT, TS_R_CERTIFICATE_VERIFY_ERROR); | 246 | TSerr(TS_F_TS_VERIFY_CERT, TS_R_CERTIFICATE_VERIFY_ERROR); |
| 247 | ERR_add_error_data(2, "Verify error:", | 247 | ERR_asprintf_error_data("Verify error:%s", |
| 248 | X509_verify_cert_error_string(j)); | 248 | X509_verify_cert_error_string(j)); |
| 249 | ret = 0; | 249 | ret = 0; |
| 250 | } else { | 250 | } else { |
| @@ -530,11 +530,11 @@ TS_check_status_info(TS_RESP *response) | |||
| 530 | 530 | ||
| 531 | /* Making up the error string. */ | 531 | /* Making up the error string. */ |
| 532 | TSerr(TS_F_TS_CHECK_STATUS_INFO, TS_R_NO_TIME_STAMP_TOKEN); | 532 | TSerr(TS_F_TS_CHECK_STATUS_INFO, TS_R_NO_TIME_STAMP_TOKEN); |
| 533 | ERR_add_error_data(6, | 533 | ERR_asprintf_error_data |
| 534 | "status code: ", status_text, | 534 | ("status code: %s, status text: %s, failure codes: %s", |
| 535 | ", status text: ", embedded_status_text ? | 535 | status_text, |
| 536 | embedded_status_text : "unspecified", | 536 | embedded_status_text ? embedded_status_text : "unspecified", |
| 537 | ", failure codes: ", failure_text); | 537 | failure_text); |
| 538 | free(embedded_status_text); | 538 | free(embedded_status_text); |
| 539 | 539 | ||
| 540 | return 0; | 540 | return 0; |
