Commit 9fa27f3b authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

rsaenh: Move type-check before len-check (Coverity).

parent ded9943b
......@@ -62,12 +62,6 @@ int rand_prime(mp_int *N, long len)
{
int type;
/* allow sizes between 2 and 256 bytes for a prime size */
if (len < 16 || len > 8192) {
printf("Invalid prime size!\n");
return CRYPT_INVALID_PRIME_SIZE;
}
/* get type */
if (len < 0) {
type = LTM_PRIME_BBS;
......@@ -78,6 +72,12 @@ int rand_prime(mp_int *N, long len)
/* Original LibTomCrypt: type = 0; */
}
/* allow sizes between 2 and 256 bytes for a prime size */
if (len < 16 || len > 8192) {
printf("Invalid prime size!\n");
return CRYPT_INVALID_PRIME_SIZE;
}
/* New prime generation makes the code even more cryptoish-insane. Do you know what this means!!!
-- Gir: Yeah, oh wait, er, no.
*/
......
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