diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libtls/tls_signer.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/libtls/tls_signer.c b/src/lib/libtls/tls_signer.c index 5eb3707454..95a3640d7a 100644 --- a/src/lib/libtls/tls_signer.c +++ b/src/lib/libtls/tls_signer.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls_signer.c,v 1.10 2024/03/26 06:24:52 joshua Exp $ */ | 1 | /* $OpenBSD: tls_signer.c,v 1.11 2024/03/28 02:08:24 joshua Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2021 Eric Faurot <eric@openbsd.org> | 3 | * Copyright (c) 2021 Eric Faurot <eric@openbsd.org> |
| 4 | * | 4 | * |
| @@ -128,8 +128,8 @@ tls_signer_add_keypair_mem(struct tls_signer *signer, const uint8_t *cert, | |||
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | if ((skey = calloc(1, sizeof(*skey))) == NULL) { | 130 | if ((skey = calloc(1, sizeof(*skey))) == NULL) { |
| 131 | tls_error_set(&signer->error, TLS_ERROR_UNKNOWN, | 131 | tls_error_set(&signer->error, TLS_ERROR_OUT_OF_MEMORY, |
| 132 | "failed to create key entry"); | 132 | "out of memory"); |
| 133 | goto err; | 133 | goto err; |
| 134 | } | 134 | } |
| 135 | skey->hash = hash; | 135 | skey->hash = hash; |
| @@ -214,7 +214,8 @@ tls_sign_rsa(struct tls_signer *signer, struct tls_signer_key *skey, | |||
| 214 | return (-1); | 214 | return (-1); |
| 215 | } | 215 | } |
| 216 | if ((signature = calloc(1, rsa_size)) == NULL) { | 216 | if ((signature = calloc(1, rsa_size)) == NULL) { |
| 217 | tls_error_set(&signer->error, TLS_ERROR_UNKNOWN, "RSA signature"); | 217 | tls_error_set(&signer->error, TLS_ERROR_OUT_OF_MEMORY, |
| 218 | "out of memory"); | ||
| 218 | return (-1); | 219 | return (-1); |
| 219 | } | 220 | } |
| 220 | 221 | ||
| @@ -261,8 +262,8 @@ tls_sign_ecdsa(struct tls_signer *signer, struct tls_signer_key *skey, | |||
| 261 | return (-1); | 262 | return (-1); |
| 262 | } | 263 | } |
| 263 | if ((signature = calloc(1, signature_len)) == NULL) { | 264 | if ((signature = calloc(1, signature_len)) == NULL) { |
| 264 | tls_error_set(&signer->error, TLS_ERROR_UNKNOWN, | 265 | tls_error_set(&signer->error, TLS_ERROR_OUT_OF_MEMORY, |
| 265 | "ECDSA signature"); | 266 | "out of memory"); |
| 266 | return (-1); | 267 | return (-1); |
| 267 | } | 268 | } |
| 268 | 269 | ||
