diff options
author | Niels Provos <provos@cvs.openbsd.org> | 2000-12-11 02:16:52 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 2000-12-11 02:16:52 +0000 |
commit | cfd74042b68880653d0f7ed8ea053c8f412e2ff4 (patch) | |
tree | 49dcb1629d5f32511b84dc43c89bb0076b875417 /sbin/photurisd/handle_value_response.c | |
parent | 31961be8cac921b7a23b2fc5d29708250a64e62d (diff) |
make it use bignum.
Diffstat (limited to 'sbin/photurisd/handle_value_response.c')
-rw-r--r-- | sbin/photurisd/handle_value_response.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sbin/photurisd/handle_value_response.c b/sbin/photurisd/handle_value_response.c index cd07867fa9a..61769b4a456 100644 --- a/sbin/photurisd/handle_value_response.c +++ b/sbin/photurisd/handle_value_response.c @@ -34,7 +34,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: handle_value_response.c,v 1.1 1998/11/14 23:37:24 deraadt Exp $"; +static char rcsid[] = "$Id: handle_value_response.c,v 1.2 2000/12/11 02:16:50 provos Exp $"; #endif #include <stdlib.h> @@ -73,7 +73,7 @@ handle_value_response(u_char *packet, int size, char *address, }; struct value_response *header; struct stateob *st; - mpz_t test; + BIGNUM *test; if (size < VALUE_RESPONSE_MIN) return -1; /* packet too small */ @@ -93,12 +93,13 @@ handle_value_response(u_char *packet, int size, char *address, return -1; /* We don't want this packet */ /* Now check the exchange value for defects */ - mpz_init_set_varpre(test, parts[0].where); + test = BN_new(); + BN_varpre2bn(parts[0].where, parts[0].size, test); if (!exchange_check_value(test, st->generator, st->modulus)) { - mpz_clear(test); + BN_clear_free(test); return 0; } - mpz_clear(test); + BN_clear_free(test); /* Reserved Field for TBV */ bcopy(header->reserved, st->uSPITBV, 3); |