提交 2fc9b36a 编写于 作者: G Geoff Thorpe 提交者: Richard Levitte

bn: catch negative zero as an error

Change-Id: I5ab72ad0aae9069b47d5b7b7b9e25bd1b7afa251
Signed-off-by: NGeoff Thorpe <geoff@openssl.org>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1672)
上级 0b50ac1a
......@@ -177,8 +177,8 @@ int RAND_bytes(unsigned char *buf, int num);
do { \
const BIGNUM *_bnum2 = (a); \
if (_bnum2 != NULL) { \
OPENSSL_assert((_bnum2->top == 0) || \
(_bnum2->d[_bnum2->top - 1] != 0)); \
OPENSSL_assert(((_bnum2->top == 0) && !_bnum2->neg) || \
(_bnum2->top && (_bnum2->d[_bnum2->top - 1] != 0))); \
bn_pollute(_bnum2); \
} \
} while(0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册