fixing keylength bug at the right place:
we usually don't touch output parameters if operations fails
This commit is contained in:
@@ -210,21 +210,13 @@ static bool get_algorithm(private_proposal_t *this, transform_type_t type,
|
||||
u_int16_t *alg, u_int16_t *key_size)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
bool found;
|
||||
bool found = FALSE;
|
||||
|
||||
enumerator = create_enumerator(this, type);
|
||||
if (enumerator->enumerate(enumerator, alg, key_size))
|
||||
{
|
||||
found = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (key_size)
|
||||
{
|
||||
*key_size = 0;
|
||||
}
|
||||
found = FALSE;
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
return found;
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ static bool derive_child_keys(private_keymat_t *this,
|
||||
chunk_t *encr_i, chunk_t *integ_i,
|
||||
chunk_t *encr_r, chunk_t *integ_r)
|
||||
{
|
||||
u_int16_t enc_alg, int_alg, enc_size, int_size;
|
||||
u_int16_t enc_alg, int_alg, enc_size = 0, int_size = 0;
|
||||
chunk_t seed, secret = chunk_empty;
|
||||
prf_plus_t *prf_plus;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user