Commit 0f47bb98 authored by Niels Möller's avatar Niels Möller
Browse files

* src/rsa.c (parse_ssh_rsa_public): Call rsa_check_size, to make

sure that the ->size attribute is initialized.

Rev: src/rsa.c:1.14
parent 1af8364c
......@@ -311,6 +311,12 @@ do_rsa_public_spki_key(struct verifier *s)
-1);
}
/* NOTE: To initialize an rsa verifier, one must
*
* 1. Call this function.
* 2. Initialize the modulo n and exponent e.
* 3. Call rsa_check_size.
*/
static void
init_rsa_verifier(struct rsa_verifier *self, struct rsa_algorithm *params)
{
......@@ -321,6 +327,8 @@ init_rsa_verifier(struct rsa_verifier *self, struct rsa_algorithm *params)
mpz_init(self->n);
mpz_init(self->e);
self->size = 0;
self->super.verify = do_rsa_verify;
self->super.verify_spki = do_rsa_verify_spki;
self->super.public_key = do_rsa_public_key;
......@@ -360,7 +368,8 @@ parse_ssh_rsa_public(struct simple_buffer *buffer)
&& parse_bignum(buffer, res->n, RSA_MAX_SIZE)
&& (mpz_sgn(res->n) == 1)
&& (mpz_cmp(res->e, res->n) < 0)
&& parse_eod(buffer))
&& parse_eod(buffer)
&& rsa_check_size(res))
return &res->super;
else
......
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