[or-cvs] Backport: discard special bignum values
Nick Mathewson
nickm at seul.org
Fri Aug 5 19:01:06 UTC 2005
Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv6011/src/common
Modified Files:
Tag: tor-0_1_0-patches
crypto.c
Log Message:
Backport: discard special bignum values
Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/crypto.c,v
retrieving revision 1.137.2.4
retrieving revision 1.137.2.5
diff -u -d -r1.137.2.4 -r1.137.2.5
--- crypto.c 4 Aug 2005 23:19:23 -0000 1.137.2.4
+++ crypto.c 5 Aug 2005 19:01:04 -0000 1.137.2.5
@@ -1379,6 +1379,10 @@
log_fn(LOG_WARN, "bn<0");
return -1;
}
+ if (BN_cmp(bn,dh_param_p)>=0) {
+ log_fn(LOG_WARN, "bn>=p");
+ return -1;
+ }
for (i=0; i < N_XX_GX; ++i) {
if (!BN_cmp(bn, dh_gx_xx[i])) {
char *which = BN_bn2hex(dh_gx_xx[i]);
More information about the tor-commits
mailing list