diff options
author | Niels Möller <nisse@lysator.liu.se> | 2002-11-16 00:24:41 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2002-11-16 00:24:41 +0100 |
commit | 8aeecc155d3aef5dae8762ace236dd6365fb636d (patch) | |
tree | 6ec4373e726fb46a714c85b23a8561fd58bbe004 /sexp2dsa.c | |
parent | 093e19c07e1812f8dcd52eb4b18f48ab85778a69 (diff) | |
download | nettle-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.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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. * |