Make x25519_compute_key() return a boolean
authorhuangqinjin <huangqinjin@gmail.com>
Thu, 23 Jun 2016 15:51:08 +0000 (23:51 +0800)
committerMatt Caswell <matt@openssl.org>
Thu, 23 Jun 2016 16:13:23 +0000 (17:13 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/ec/ec_25519.c

index 4a9e3c9ff0dba402d0e7f0cedaaa209167ef0181..035a415347e3105abccf3be54a4128b775abcb1e 100644 (file)
@@ -253,9 +253,9 @@ static int x25519_compute_key(unsigned char **psec, size_t *pseclen,
                               const EC_POINT *pub_key, const EC_KEY *ecdh)
 {
     unsigned char *key;
                               const EC_POINT *pub_key, const EC_KEY *ecdh)
 {
     unsigned char *key;
-    int ret = -1;
+    int ret = 0;
     if (ecdh->custom_data == NULL)
     if (ecdh->custom_data == NULL)
-        return -1;
+        return 0;
     key = OPENSSL_malloc(EC_X25519_KEYLEN);
     if (key == NULL)
         return 0;
     key = OPENSSL_malloc(EC_X25519_KEYLEN);
     if (key == NULL)
         return 0;