diff options
| author | beck <> | 2017-01-29 17:49:23 +0000 | 
|---|---|---|
| committer | beck <> | 2017-01-29 17:49:23 +0000 | 
| commit | d1f47bd292f36094480caa49ada36b99a69c59b0 (patch) | |
| tree | 1a54abba678898ee5270ae4f3404a50ee9a92eea /src/lib/libcrypto/ts/ts_rsp_utils.c | |
| parent | f8c627888330b75c2eea8a3c27d0efe947a4f9da (diff) | |
| download | openbsd-d1f47bd292f36094480caa49ada36b99a69c59b0.tar.gz openbsd-d1f47bd292f36094480caa49ada36b99a69c59b0.tar.bz2 openbsd-d1f47bd292f36094480caa49ada36b99a69c59b0.zip  | |
Send the function codes from the error functions to the bit bucket,
as was done earlier in libssl. Thanks inoguchi@ for noticing
libssl had more reacharounds into this.
ok jsing@ inoguchi@
Diffstat (limited to 'src/lib/libcrypto/ts/ts_rsp_utils.c')
| -rw-r--r-- | src/lib/libcrypto/ts/ts_rsp_utils.c | 26 | 
1 files changed, 12 insertions, 14 deletions
diff --git a/src/lib/libcrypto/ts/ts_rsp_utils.c b/src/lib/libcrypto/ts/ts_rsp_utils.c index 39eb2a2963..5638331d17 100644 --- a/src/lib/libcrypto/ts/ts_rsp_utils.c +++ b/src/lib/libcrypto/ts/ts_rsp_utils.c  | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ts_rsp_utils.c,v 1.5 2015/07/29 14:58:34 jsing Exp $ */ | 1 | /* $OpenBSD: ts_rsp_utils.c,v 1.6 2017/01/29 17:49:23 beck Exp $ */ | 
| 2 | /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL | 2 | /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL | 
| 3 | * project 2002. | 3 | * project 2002. | 
| 4 | */ | 4 | */ | 
| @@ -74,7 +74,7 @@ TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *status_info) | |||
| 74 | return 1; | 74 | return 1; | 
| 75 | new_status_info = TS_STATUS_INFO_dup(status_info); | 75 | new_status_info = TS_STATUS_INFO_dup(status_info); | 
| 76 | if (new_status_info == NULL) { | 76 | if (new_status_info == NULL) { | 
| 77 | TSerr(TS_F_TS_RESP_SET_STATUS_INFO, ERR_R_MALLOC_FAILURE); | 77 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 78 | return 0; | 78 | return 0; | 
| 79 | } | 79 | } | 
| 80 | TS_STATUS_INFO_free(a->status_info); | 80 | TS_STATUS_INFO_free(a->status_info); | 
| @@ -133,7 +133,7 @@ TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy) | |||
| 133 | return 1; | 133 | return 1; | 
| 134 | new_policy = OBJ_dup(policy); | 134 | new_policy = OBJ_dup(policy); | 
| 135 | if (new_policy == NULL) { | 135 | if (new_policy == NULL) { | 
| 136 | TSerr(TS_F_TS_TST_INFO_SET_POLICY_ID, ERR_R_MALLOC_FAILURE); | 136 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 137 | return 0; | 137 | return 0; | 
| 138 | } | 138 | } | 
| 139 | ASN1_OBJECT_free(a->policy_id); | 139 | ASN1_OBJECT_free(a->policy_id); | 
| @@ -156,7 +156,7 @@ TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint) | |||
| 156 | return 1; | 156 | return 1; | 
| 157 | new_msg_imprint = TS_MSG_IMPRINT_dup(msg_imprint); | 157 | new_msg_imprint = TS_MSG_IMPRINT_dup(msg_imprint); | 
| 158 | if (new_msg_imprint == NULL) { | 158 | if (new_msg_imprint == NULL) { | 
| 159 | TSerr(TS_F_TS_TST_INFO_SET_MSG_IMPRINT, ERR_R_MALLOC_FAILURE); | 159 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 160 | return 0; | 160 | return 0; | 
| 161 | } | 161 | } | 
| 162 | TS_MSG_IMPRINT_free(a->msg_imprint); | 162 | TS_MSG_IMPRINT_free(a->msg_imprint); | 
| @@ -179,7 +179,7 @@ TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial) | |||
| 179 | return 1; | 179 | return 1; | 
| 180 | new_serial = ASN1_INTEGER_dup(serial); | 180 | new_serial = ASN1_INTEGER_dup(serial); | 
| 181 | if (new_serial == NULL) { | 181 | if (new_serial == NULL) { | 
| 182 | TSerr(TS_F_TS_TST_INFO_SET_SERIAL, ERR_R_MALLOC_FAILURE); | 182 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 183 | return 0; | 183 | return 0; | 
| 184 | } | 184 | } | 
| 185 | ASN1_INTEGER_free(a->serial); | 185 | ASN1_INTEGER_free(a->serial); | 
| @@ -202,7 +202,7 @@ TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime) | |||
| 202 | return 1; | 202 | return 1; | 
| 203 | new_time = ASN1_STRING_dup(gtime); | 203 | new_time = ASN1_STRING_dup(gtime); | 
| 204 | if (new_time == NULL) { | 204 | if (new_time == NULL) { | 
| 205 | TSerr(TS_F_TS_TST_INFO_SET_TIME, ERR_R_MALLOC_FAILURE); | 205 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 206 | return 0; | 206 | return 0; | 
| 207 | } | 207 | } | 
| 208 | ASN1_GENERALIZEDTIME_free(a->time); | 208 | ASN1_GENERALIZEDTIME_free(a->time); | 
| @@ -225,7 +225,7 @@ TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy) | |||
| 225 | return 1; | 225 | return 1; | 
| 226 | new_accuracy = TS_ACCURACY_dup(accuracy); | 226 | new_accuracy = TS_ACCURACY_dup(accuracy); | 
| 227 | if (new_accuracy == NULL) { | 227 | if (new_accuracy == NULL) { | 
| 228 | TSerr(TS_F_TS_TST_INFO_SET_ACCURACY, ERR_R_MALLOC_FAILURE); | 228 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 229 | return 0; | 229 | return 0; | 
| 230 | } | 230 | } | 
| 231 | TS_ACCURACY_free(a->accuracy); | 231 | TS_ACCURACY_free(a->accuracy); | 
| @@ -248,7 +248,7 @@ TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds) | |||
| 248 | return 1; | 248 | return 1; | 
| 249 | new_seconds = ASN1_INTEGER_dup(seconds); | 249 | new_seconds = ASN1_INTEGER_dup(seconds); | 
| 250 | if (new_seconds == NULL) { | 250 | if (new_seconds == NULL) { | 
| 251 | TSerr(TS_F_TS_ACCURACY_SET_SECONDS, ERR_R_MALLOC_FAILURE); | 251 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 252 | return 0; | 252 | return 0; | 
| 253 | } | 253 | } | 
| 254 | ASN1_INTEGER_free(a->seconds); | 254 | ASN1_INTEGER_free(a->seconds); | 
| @@ -272,8 +272,7 @@ TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis) | |||
| 272 | if (millis != NULL) { | 272 | if (millis != NULL) { | 
| 273 | new_millis = ASN1_INTEGER_dup(millis); | 273 | new_millis = ASN1_INTEGER_dup(millis); | 
| 274 | if (new_millis == NULL) { | 274 | if (new_millis == NULL) { | 
| 275 | TSerr(TS_F_TS_ACCURACY_SET_MILLIS, | 275 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 276 | ERR_R_MALLOC_FAILURE); | ||
| 277 | return 0; | 276 | return 0; | 
| 278 | } | 277 | } | 
| 279 | } | 278 | } | 
| @@ -298,8 +297,7 @@ TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros) | |||
| 298 | if (micros != NULL) { | 297 | if (micros != NULL) { | 
| 299 | new_micros = ASN1_INTEGER_dup(micros); | 298 | new_micros = ASN1_INTEGER_dup(micros); | 
| 300 | if (new_micros == NULL) { | 299 | if (new_micros == NULL) { | 
| 301 | TSerr(TS_F_TS_ACCURACY_SET_MICROS, | 300 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 302 | ERR_R_MALLOC_FAILURE); | ||
| 303 | return 0; | 301 | return 0; | 
| 304 | } | 302 | } | 
| 305 | } | 303 | } | 
| @@ -336,7 +334,7 @@ TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce) | |||
| 336 | return 1; | 334 | return 1; | 
| 337 | new_nonce = ASN1_INTEGER_dup(nonce); | 335 | new_nonce = ASN1_INTEGER_dup(nonce); | 
| 338 | if (new_nonce == NULL) { | 336 | if (new_nonce == NULL) { | 
| 339 | TSerr(TS_F_TS_TST_INFO_SET_NONCE, ERR_R_MALLOC_FAILURE); | 337 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 340 | return 0; | 338 | return 0; | 
| 341 | } | 339 | } | 
| 342 | ASN1_INTEGER_free(a->nonce); | 340 | ASN1_INTEGER_free(a->nonce); | 
| @@ -359,7 +357,7 @@ TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa) | |||
| 359 | return 1; | 357 | return 1; | 
| 360 | new_tsa = GENERAL_NAME_dup(tsa); | 358 | new_tsa = GENERAL_NAME_dup(tsa); | 
| 361 | if (new_tsa == NULL) { | 359 | if (new_tsa == NULL) { | 
| 362 | TSerr(TS_F_TS_TST_INFO_SET_TSA, ERR_R_MALLOC_FAILURE); | 360 | TSerror(ERR_R_MALLOC_FAILURE); | 
| 363 | return 0; | 361 | return 0; | 
| 364 | } | 362 | } | 
| 365 | GENERAL_NAME_free(a->tsa); | 363 | GENERAL_NAME_free(a->tsa); | 
