Commit 8aeecc15 authored by Niels Möller's avatar Niels Möller

(macro GET): Check sign of parsed

numbers.

Rev: src/nettle/sexp2dsa.c:1.2
Rev: src/nettle/sexp2rsa.c:1.9
parent 093e19c0
......@@ -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.
*
......
......@@ -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.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment