diff options
author | Martin Willi <martin@revosec.ch> | 2012-07-09 15:33:41 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-07-16 14:55:06 +0200 |
commit | 8bd6a30af1b745f65f60130d4735df05096e07ce (patch) | |
tree | 8834701cea8764fb47281ea533096ec5dcc20b81 /src/libcharon/plugins/tnc_pdp/tnc_pdp.c | |
parent | ce73fc19dbc36d089e595e452356deccd8afcd6f (diff) | |
download | strongswan-8bd6a30af1b745f65f60130d4735df05096e07ce.tar.bz2 strongswan-8bd6a30af1b745f65f60130d4735df05096e07ce.tar.xz |
Add a return value to hasher_t.get_hash()
Diffstat (limited to 'src/libcharon/plugins/tnc_pdp/tnc_pdp.c')
-rw-r--r-- | src/libcharon/plugins/tnc_pdp/tnc_pdp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libcharon/plugins/tnc_pdp/tnc_pdp.c b/src/libcharon/plugins/tnc_pdp/tnc_pdp.c index 691136430..709145877 100644 --- a/src/libcharon/plugins/tnc_pdp/tnc_pdp.c +++ b/src/libcharon/plugins/tnc_pdp/tnc_pdp.c @@ -231,8 +231,12 @@ static chunk_t encrypt_mppe_key(private_tnc_pdp_t *this, u_int8_t type, while (c < data.ptr + data.len) { /* b(i) = MD5(S + c(i-1)) */ - this->hasher->get_hash(this->hasher, this->secret, NULL); - this->hasher->get_hash(this->hasher, seed, b); + if (!this->hasher->get_hash(this->hasher, this->secret, NULL) || + !this->hasher->get_hash(this->hasher, seed, b)) + { + free(data.ptr); + return chunk_empty; + } /* c(i) = b(i) xor p(1) */ memxor(c, b, HASH_SIZE_MD5); |