|
Description
|
pk11_DH_compute_key() returns 0 in the case of failure:
2004 CK_RV rv;
2005 int ret = 0; << default return value
2006 PK11_SESSION *sp = NULL;
2007 char tmp_buf[20];
but DH_generate_key(3) OpenSSL man page says:
RETURN VALUES
DH_generate_key() returns 1 on success, 0 otherwise.
DH_compute_key() returns the size of the shared secret on
success, -1 on error.
and native OpenSSL implementation $SRC/common/openssl/crypto/dh/dh_key.c:compute_key() confirms this:
174 static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
175 {
176 BN_CTX *ctx;
177 BN_MONT_CTX *mont=NULL;
178 BIGNUM *tmp;
179 int ret= -1;
180 int check_result;
|