From 957b11334a7afb14537322f0e4795b2e368b3f59 Mon Sep 17 00:00:00 2001 From: beck <> Date: Sun, 29 Jan 2017 17:49:23 +0000 Subject: 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@ --- src/lib/libcrypto/ts/ts_rsp_utils.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/lib/libcrypto/ts/ts_rsp_utils.c') 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 @@ -/* $OpenBSD: ts_rsp_utils.c,v 1.5 2015/07/29 14:58:34 jsing Exp $ */ +/* $OpenBSD: ts_rsp_utils.c,v 1.6 2017/01/29 17:49:23 beck Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ @@ -74,7 +74,7 @@ TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *status_info) return 1; new_status_info = TS_STATUS_INFO_dup(status_info); if (new_status_info == NULL) { - TSerr(TS_F_TS_RESP_SET_STATUS_INFO, ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } TS_STATUS_INFO_free(a->status_info); @@ -133,7 +133,7 @@ TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy) return 1; new_policy = OBJ_dup(policy); if (new_policy == NULL) { - TSerr(TS_F_TS_TST_INFO_SET_POLICY_ID, ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } 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) return 1; new_msg_imprint = TS_MSG_IMPRINT_dup(msg_imprint); if (new_msg_imprint == NULL) { - TSerr(TS_F_TS_TST_INFO_SET_MSG_IMPRINT, ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } TS_MSG_IMPRINT_free(a->msg_imprint); @@ -179,7 +179,7 @@ TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial) return 1; new_serial = ASN1_INTEGER_dup(serial); if (new_serial == NULL) { - TSerr(TS_F_TS_TST_INFO_SET_SERIAL, ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } ASN1_INTEGER_free(a->serial); @@ -202,7 +202,7 @@ TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime) return 1; new_time = ASN1_STRING_dup(gtime); if (new_time == NULL) { - TSerr(TS_F_TS_TST_INFO_SET_TIME, ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } ASN1_GENERALIZEDTIME_free(a->time); @@ -225,7 +225,7 @@ TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy) return 1; new_accuracy = TS_ACCURACY_dup(accuracy); if (new_accuracy == NULL) { - TSerr(TS_F_TS_TST_INFO_SET_ACCURACY, ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } TS_ACCURACY_free(a->accuracy); @@ -248,7 +248,7 @@ TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds) return 1; new_seconds = ASN1_INTEGER_dup(seconds); if (new_seconds == NULL) { - TSerr(TS_F_TS_ACCURACY_SET_SECONDS, ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } ASN1_INTEGER_free(a->seconds); @@ -272,8 +272,7 @@ TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis) if (millis != NULL) { new_millis = ASN1_INTEGER_dup(millis); if (new_millis == NULL) { - TSerr(TS_F_TS_ACCURACY_SET_MILLIS, - ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } } @@ -298,8 +297,7 @@ TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros) if (micros != NULL) { new_micros = ASN1_INTEGER_dup(micros); if (new_micros == NULL) { - TSerr(TS_F_TS_ACCURACY_SET_MICROS, - ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } } @@ -336,7 +334,7 @@ TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce) return 1; new_nonce = ASN1_INTEGER_dup(nonce); if (new_nonce == NULL) { - TSerr(TS_F_TS_TST_INFO_SET_NONCE, ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } ASN1_INTEGER_free(a->nonce); @@ -359,7 +357,7 @@ TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa) return 1; new_tsa = GENERAL_NAME_dup(tsa); if (new_tsa == NULL) { - TSerr(TS_F_TS_TST_INFO_SET_TSA, ERR_R_MALLOC_FAILURE); + TSerror(ERR_R_MALLOC_FAILURE); return 0; } GENERAL_NAME_free(a->tsa); -- cgit v1.2.3-55-g6feb