Skip to content
Snippets Groups Projects
Commit 8aeecc15 authored by Niels Möller's avatar Niels Möller
Browse files

(macro GET): Check sign of parsed

numbers.

Rev: src/nettle/sexp2dsa.c:1.2
Rev: src/nettle/sexp2rsa.c:1.9
parent 093e19c0
No related branches found
No related tags found
No related merge requests found
...@@ -35,8 +35,12 @@ ...@@ -35,8 +35,12 @@
#include <string.h> #include <string.h>
#define GET(x, l, v) \ #define GET(x, l, v) \
do { if (!nettle_mpz_set_sexp((x), (l), (v))) return 0; } while(0) 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. /* Iterator should point past the algorithm tag, e.g.
* *
......
...@@ -35,8 +35,12 @@ ...@@ -35,8 +35,12 @@
#include <string.h> #include <string.h>
#define GET(x, l, v) \ #define GET(x, l, v) \
do { if (!nettle_mpz_set_sexp((x), (l), (v))) return 0; } while(0) 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. /* Iterator should point past the algorithm tag, e.g.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment