/**
* Add supported IKE algorithms to proposal
*/
-static void proposal_add_supported_ike(private_proposal_t *this, bool aead)
+static bool proposal_add_supported_ike(private_proposal_t *this, bool aead)
{
enumerator_t *enumerator;
encryption_algorithm_t encryption;
}
}
enumerator->destroy(enumerator);
+
+ if (!array_count(this->transforms))
+ {
+ return FALSE;
+ }
}
else
{
}
enumerator->destroy(enumerator);
+ if (!array_count(this->transforms))
+ {
+ return FALSE;
+ }
+
enumerator = lib->crypto->create_signer_enumerator(lib->crypto);
while (enumerator->enumerate(enumerator, &integrity, &plugin_name))
{
}
}
enumerator->destroy(enumerator);
+
+ return TRUE;
}
/*
switch (protocol)
{
case PROTO_IKE:
- proposal_add_supported_ike(this, FALSE);
+ if (!proposal_add_supported_ike(this, FALSE))
+ {
+ destroy(this);
+ return NULL;
+ }
break;
case PROTO_ESP:
add_algorithm(this, ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 128);
{
case PROTO_IKE:
this = (private_proposal_t*)proposal_create(protocol, 0);
- proposal_add_supported_ike(this, TRUE);
+ if (!proposal_add_supported_ike(this, TRUE))
+ {
+ destroy(this);
+ return NULL;
+ }
return &this->public;
case PROTO_ESP:
/* we currently don't include any AEAD proposal for ESP, as we