From e35abbe588636c5ca73d8aaa9082314289346bd9 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 6 Jul 2012 15:54:03 +0200 Subject: Add a return value to crypter_t.encrypt --- src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c') diff --git a/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c b/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c index 6e4eff689..c5c531e31 100644 --- a/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c +++ b/src/libcharon/plugins/eap_mschapv2/eap_mschapv2.c @@ -337,9 +337,15 @@ static status_t ChallengeResponse(chunk_t challenge_hash, chunk_t password_hash, for (i = 0; i < 3; i++) { chunk_t expanded, encrypted; + expanded = ExpandDESKey(keys[i]); crypter->set_key(crypter, expanded); - crypter->encrypt(crypter, challenge_hash, chunk_empty, &encrypted); + if (!crypter->encrypt(crypter, challenge_hash, chunk_empty, &encrypted)) + { + chunk_clear(&expanded); + crypter->destroy(crypter); + return FAILED; + } memcpy(&response->ptr[i * 8], encrypted.ptr, encrypted.len); chunk_clear(&encrypted); chunk_clear(&expanded); -- cgit v1.2.3