summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_lib.c
diff options
context:
space:
mode:
authorjsing <>2022-11-23 03:10:10 +0000
committerjsing <>2022-11-23 03:10:10 +0000
commit18fd3b0a66fb6b89d05631662dad5467cb0ee3bb (patch)
treeebbcc77732029817b196e897af247c3a859a9ce9 /src/lib/libcrypto/bn/bn_lib.c
parentbc4574576aa870ae46b89eb9506a76cdccea8db2 (diff)
downloadopenbsd-18fd3b0a66fb6b89d05631662dad5467cb0ee3bb.tar.gz
openbsd-18fd3b0a66fb6b89d05631662dad5467cb0ee3bb.tar.bz2
openbsd-18fd3b0a66fb6b89d05631662dad5467cb0ee3bb.zip
Use bn_wexpand() rather than bn_expand() with sizeof(BN_ULONG).
This also fixes a bug in BN_MONT_CTX_set(), where the sizeof(BN_ULONG) in the call to bn_expand() was not multiplied by eight (to get bits). ok tb@
Diffstat (limited to 'src/lib/libcrypto/bn/bn_lib.c')
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index 15bbdf1273..1c079b004a 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_lib.c,v 1.59 2022/11/23 03:04:52 jsing Exp $ */ 1/* $OpenBSD: bn_lib.c,v 1.60 2022/11/23 03:10:10 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -518,7 +518,7 @@ int
518BN_set_word(BIGNUM *a, BN_ULONG w) 518BN_set_word(BIGNUM *a, BN_ULONG w)
519{ 519{
520 bn_check_top(a); 520 bn_check_top(a);
521 if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 521 if (bn_wexpand(a, 1) == NULL)
522 return (0); 522 return (0);
523 a->neg = 0; 523 a->neg = 0;
524 a->d[0] = w; 524 a->d[0] = w;