artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
89b63e6
)
Check for non-zero length rather than a zero value.
author
jsing
<jsing@openbsd.org>
Sat, 24 Jun 2023 16:10:23 +0000
(16:10 +0000)
committer
jsing
<jsing@openbsd.org>
Sat, 24 Jun 2023 16:10:23 +0000
(16:10 +0000)
This removes a data dependent timing path from BN_sqr().
ok tb@
lib/libcrypto/bn/bn_sqr.c
patch
|
blob
|
history
diff --git
a/lib/libcrypto/bn/bn_sqr.c
b/lib/libcrypto/bn/bn_sqr.c
index
4eab796
..
5f3be22
100644
(file)
--- a/
lib/libcrypto/bn/bn_sqr.c
+++ b/
lib/libcrypto/bn/bn_sqr.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: bn_sqr.c,v 1.3
1 2023/06/24 16:01:4
3 jsing Exp $ */
+/* $OpenBSD: bn_sqr.c,v 1.3
2 2023/06/24 16:10:2
3 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@
-274,7
+274,7
@@
BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
BN_CTX_start(ctx);
- if (
BN_is_zero(a)
) {
+ if (
a->top < 1
) {
BN_zero(r);
goto done;
}