summaryrefslogtreecommitdiff
path: root/sexp2dsa.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2002-11-16 00:24:41 +0100
committerNiels Möller <nisse@lysator.liu.se>2002-11-16 00:24:41 +0100
commit8aeecc155d3aef5dae8762ace236dd6365fb636d (patch)
tree6ec4373e726fb46a714c85b23a8561fd58bbe004 /sexp2dsa.c
parent093e19c07e1812f8dcd52eb4b18f48ab85778a69 (diff)
downloadnettle-8aeecc155d3aef5dae8762ace236dd6365fb636d.tar.gz
(macro GET): Check sign of parsed
numbers. Rev: src/nettle/sexp2dsa.c:1.2 Rev: src/nettle/sexp2rsa.c:1.9
Diffstat (limited to 'sexp2dsa.c')
-rw-r--r--sexp2dsa.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sexp2dsa.c b/sexp2dsa.c
index e7731cc6..357b3cf8 100644
--- a/sexp2dsa.c
+++ b/sexp2dsa.c
@@ -35,8 +35,12 @@
#include <string.h>
-#define GET(x, l, v) \
-do { if (!nettle_mpz_set_sexp((x), (l), (v))) return 0; } while(0)
+#define GET(x, l, v) \
+do { \
+ if (!nettle_mpz_set_sexp((x), (l), (v)) \
+ || mpz_sgn(x) <= 0) \
+ return 0; \
+} while(0)
/* Iterator should point past the algorithm tag, e.g.
*