fixing keylength bug at the right place:

we usually don't touch output parameters if operations fails
This commit is contained in:
Martin Willi
2008-11-12 08:27:48 +00:00
parent 137484895a
commit 9fa5c75f48
2 changed files with 2 additions and 10 deletions
+1 -9
View File
@@ -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;
}
+1 -1
View File
@@ -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;