From d758c114b0641c810d6abd7930b7e232de7109bd Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Wed, 12 Apr 2017 10:00:29 -0600 Subject: [PATCH] fix return value --- wolfcrypt/src/evp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index 1b08e0480..964b87dc1 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -699,6 +699,16 @@ WOLFSSL_API int wolfSSL_EVP_PKEY_decrypt_init(WOLFSSL_EVP_PKEY_CTX *ctx) } } +/* Use a WOLFSSL_EVP_PKEY_CTX structure to encrypt data + * + * ctx WOLFSSL_EVP_PKEY_CTX structure to use with encryption + * out buffer to hold encrypted data + * outlen length of out buffer + * in data to be encrypted + * inlen length of in buffer + * + * Returns 0 on failure and 1 on success + */ WOLFSSL_API int wolfSSL_EVP_PKEY_encrypt(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, const unsigned char *in, size_t inlen) @@ -721,7 +731,7 @@ WOLFSSL_API int wolfSSL_EVP_PKEY_encrypt(WOLFSSL_EVP_PKEY_CTX *ctx, if(len < 0)return 0; else { *outlen = len ; - return len; + return 1; } #endif /* NO_RSA */