From 341829195e0c845cf26339768f275f021b69fedc Mon Sep 17 00:00:00 2001 From: tb <> Date: Mon, 15 Dec 2025 12:09:46 +0000 Subject: BN_get_word(): return (BN_ULONG)-1 on error rather than BN_MASK2 While the latter is more general in that it also works on 1-complement achitectures, we don't care about that. Adjust documentation and the only error check for it in libcrypto. ok deraadt --- src/lib/libcrypto/bn/bn_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/bn') diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c index 3e451a6191..0326e72c4d 100644 --- a/src/lib/libcrypto/bn/bn_lib.c +++ b/src/lib/libcrypto/bn/bn_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_lib.c,v 1.94 2025/05/10 05:54:38 tb Exp $ */ +/* $OpenBSD: bn_lib.c,v 1.95 2025/12/15 12:09:46 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -349,7 +349,7 @@ BN_ULONG BN_get_word(const BIGNUM *a) { if (a->top > 1) - return BN_MASK2; + return (BN_ULONG)-1; else if (a->top == 1) return a->d[0]; /* a->top == 0 */ -- cgit v1.2.3-55-g6feb