projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update copyright year
[openssl.git]
/
crypto
/
bn
/
bn_gcd.c
diff --git
a/crypto/bn/bn_gcd.c
b/crypto/bn/bn_gcd.c
index 22f80939d61eaa4361fa7db7692f7ec9df1fd563..0091ea4e08a67cf1daedf50beb5fa8278fe05000 100644
(file)
--- a/
crypto/bn/bn_gcd.c
+++ b/
crypto/bn/bn_gcd.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 1995-201
7
The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-201
8
The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@
-140,7
+140,14
@@
BIGNUM *int_bn_mod_inverse(BIGNUM *in,
BIGNUM *ret = NULL;
int sign;
BIGNUM *ret = NULL;
int sign;
- if (pnoinv)
+ /* This is invalid input so we don't worry about constant time here */
+ if (BN_abs_is_word(n, 1) || BN_is_zero(n)) {
+ if (pnoinv != NULL)
+ *pnoinv = 1;
+ return NULL;
+ }
+
+ if (pnoinv != NULL)
*pnoinv = 0;
if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
*pnoinv = 0;
if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)