diff options
| author | tb <> | 2025-12-15 12:09:46 +0000 |
|---|---|---|
| committer | tb <> | 2025-12-15 12:09:46 +0000 |
| commit | 341829195e0c845cf26339768f275f021b69fedc (patch) | |
| tree | dc3752844fd792308ae3945985b5fed6b9382317 /src/lib/libcrypto/ec | |
| parent | 20d6e4cb31df6885cb225ebc24e9924458ff01aa (diff) | |
| download | openbsd-341829195e0c845cf26339768f275f021b69fedc.tar.gz openbsd-341829195e0c845cf26339768f275f021b69fedc.tar.bz2 openbsd-341829195e0c845cf26339768f275f021b69fedc.zip | |
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
Diffstat (limited to 'src/lib/libcrypto/ec')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_curve.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ec/ec_curve.c b/src/lib/libcrypto/ec/ec_curve.c index 2838965c1e..fda2681704 100644 --- a/src/lib/libcrypto/ec/ec_curve.c +++ b/src/lib/libcrypto/ec/ec_curve.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_curve.c,v 1.59 2025/11/02 13:06:30 tb Exp $ */ | 1 | /* $OpenBSD: ec_curve.c,v 1.60 2025/12/15 12:09:46 tb Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 1998-2010 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2010 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -1392,7 +1392,7 @@ ec_curve_from_group(const EC_GROUP *group) | |||
| 1392 | if ((cofactor = EC_GROUP_get0_cofactor(group)) != NULL) { | 1392 | if ((cofactor = EC_GROUP_get0_cofactor(group)) != NULL) { |
| 1393 | BN_ULONG cofactor_word; | 1393 | BN_ULONG cofactor_word; |
| 1394 | 1394 | ||
| 1395 | if ((cofactor_word = BN_get_word(cofactor)) == BN_MASK2) | 1395 | if ((cofactor_word = BN_get_word(cofactor)) == (BN_ULONG)-1) |
| 1396 | goto err; | 1396 | goto err; |
| 1397 | if (cofactor_word > INT_MAX) | 1397 | if (cofactor_word > INT_MAX) |
| 1398 | goto err; | 1398 | goto err; |
