diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/ts/ts_rsp_sign.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ts/ts_rsp_sign.c b/src/lib/libcrypto/ts/ts_rsp_sign.c index 84a6993106..3013cffbc5 100644 --- a/src/lib/libcrypto/ts/ts_rsp_sign.c +++ b/src/lib/libcrypto/ts/ts_rsp_sign.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ts_rsp_sign.c,v 1.31 2023/07/07 07:25:21 beck Exp $ */ | 1 | /* $OpenBSD: ts_rsp_sign.c,v 1.32 2023/08/22 08:09:36 tb 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 | */ |
| @@ -98,18 +98,21 @@ static ASN1_GENERALIZEDTIME *TS_RESP_set_genTime_with_precision( | |||
| 98 | static ASN1_INTEGER * | 98 | static ASN1_INTEGER * |
| 99 | def_serial_cb(struct TS_resp_ctx *ctx, void *data) | 99 | def_serial_cb(struct TS_resp_ctx *ctx, void *data) |
| 100 | { | 100 | { |
| 101 | ASN1_INTEGER *serial = ASN1_INTEGER_new(); | 101 | ASN1_INTEGER *serial; |
| 102 | 102 | ||
| 103 | if (!serial) | 103 | if ((serial = ASN1_INTEGER_new()) == NULL) |
| 104 | goto err; | 104 | goto err; |
| 105 | if (!ASN1_INTEGER_set(serial, 1)) | 105 | if (!ASN1_INTEGER_set(serial, 1)) |
| 106 | goto err; | 106 | goto err; |
| 107 | |||
| 107 | return serial; | 108 | return serial; |
| 108 | 109 | ||
| 109 | err: | 110 | err: |
| 111 | ASN1_INTEGER_free(serial); | ||
| 110 | TSerror(ERR_R_MALLOC_FAILURE); | 112 | TSerror(ERR_R_MALLOC_FAILURE); |
| 111 | TS_RESP_CTX_set_status_info(ctx, TS_STATUS_REJECTION, | 113 | TS_RESP_CTX_set_status_info(ctx, TS_STATUS_REJECTION, |
| 112 | "Error during serial number generation."); | 114 | "Error during serial number generation."); |
| 115 | |||
| 113 | return NULL; | 116 | return NULL; |
| 114 | } | 117 | } |
| 115 | 118 | ||
