diff options
Diffstat (limited to 'providers/implementations/exchange/ecdh_exch.c')
-rw-r--r-- | providers/implementations/exchange/ecdh_exch.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/providers/implementations/exchange/ecdh_exch.c b/providers/implementations/exchange/ecdh_exch.c index 6c24643255..a1b984769e 100644 --- a/providers/implementations/exchange/ecdh_exch.c +++ b/providers/implementations/exchange/ecdh_exch.c @@ -21,6 +21,7 @@ #include <openssl/ec.h> #include <openssl/params.h> #include <openssl/err.h> +#include <openssl/proverr.h> #include "prov/provider_ctx.h" #include "prov/providercommon.h" #include "prov/implementations.h" @@ -408,7 +409,7 @@ int ecdh_plain_derive(void *vpecdhctx, unsigned char *secret, int key_cofactor_mode; if (pecdhctx->k == NULL || pecdhctx->peerk == NULL) { - ERR_raise(ERR_LIB_PROV, EC_R_KEYS_NOT_SET); + ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_KEY); return 0; } @@ -486,8 +487,10 @@ int ecdh_X9_63_kdf_derive(void *vpecdhctx, unsigned char *secret, return 1; } - if (pecdhctx->kdf_outlen > outlen) + if (pecdhctx->kdf_outlen > outlen) { + ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL); return 0; + } if (!ecdh_plain_derive(vpecdhctx, NULL, &stmplen, 0)) return 0; if ((stmp = OPENSSL_secure_malloc(stmplen)) == NULL) { |