aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2015-03-23 10:54:24 +0100
committerMartin Willi <martin@revosec.ch>2015-03-23 17:54:02 +0100
commitbace1d647971e8300c5abdb1e950adf3756ec328 (patch)
treea0ccd1429564ad37130c64bb377c1f5de6bb92d0 /src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
parent4909612c3bcfb951a3f8ecccf433756b450f4e8e (diff)
downloadstrongswan-bace1d647971e8300c5abdb1e950adf3756ec328.tar.bz2
strongswan-bace1d647971e8300c5abdb1e950adf3756ec328.tar.xz
diffie-hellman: Use bool instead of status_t as get_shared_secret() return value
While such a change is not unproblematic, keeping status_t makes the API inconsistent once we introduce return values for the public value operations.
Diffstat (limited to 'src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c')
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
index 1e68ac59b..603580277 100644
--- a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
+++ b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
@@ -70,19 +70,19 @@ METHOD(diffie_hellman_t, get_my_public_value, void,
value->ptr + value->len - BN_num_bytes(this->dh->pub_key));
}
-METHOD(diffie_hellman_t, get_shared_secret, status_t,
+METHOD(diffie_hellman_t, get_shared_secret, bool,
private_openssl_diffie_hellman_t *this, chunk_t *secret)
{
if (!this->computed)
{
- return FAILED;
+ return FALSE;
}
/* shared secret should requires a len according the DH group */
*secret = chunk_alloc(DH_size(this->dh));
memset(secret->ptr, 0, secret->len);
memcpy(secret->ptr + secret->len - this->shared_secret.len,
this->shared_secret.ptr, this->shared_secret.len);
- return SUCCESS;
+ return TRUE;
}