From c83852c11b8675efa6930be4e17c9743d2cfda4d Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 13 Jun 2023 09:12:22 +0000 Subject: Add a BN_R_INVALID_ARGUMENT error code One problem with OpenSSL error codes is that they tend to be too specific (another problem is that they are extremely ugly). So add an EINVAL-style error code. This will be used in an upcoming commit to disallow aliasing of the 'return value' with the modulus in BN_mod_* functions and should be applicable elsewhere, outside of this one narrow use case. ok jsing --- src/lib/libcrypto/bn/bn_err.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/bn/bn_err.c') diff --git a/src/lib/libcrypto/bn/bn_err.c b/src/lib/libcrypto/bn/bn_err.c index 592c509416..b861ea9374 100644 --- a/src/lib/libcrypto/bn/bn_err.c +++ b/src/lib/libcrypto/bn/bn_err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_err.c,v 1.15 2022/07/12 14:42:48 kn Exp $ */ +/* $OpenBSD: bn_err.c,v 1.16 2023/06/13 09:12:22 tb Exp $ */ /* ==================================================================== * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. * @@ -80,6 +80,7 @@ static ERR_STRING_DATA BN_str_reasons[]= { {ERR_REASON(BN_R_ENCODING_ERROR) , "encoding error"}, {ERR_REASON(BN_R_EXPAND_ON_STATIC_BIGNUM_DATA), "expand on static bignum data"}, {ERR_REASON(BN_R_INPUT_NOT_REDUCED) , "input not reduced"}, + {ERR_REASON(BN_R_INVALID_ARGUMENT) , "invalid argument"}, {ERR_REASON(BN_R_INVALID_LENGTH) , "invalid length"}, {ERR_REASON(BN_R_INVALID_RANGE) , "invalid range"}, {ERR_REASON(BN_R_NOT_A_SQUARE) , "not a square"}, -- cgit v1.2.3-55-g6feb