Commit c0cc23af authored by Pauli's avatar Pauli
Browse files

Check return from BN_sub



Reviewed-by: default avatarTim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6823)

(cherry picked from commit 3d3cbce5)
parent 35fa31cc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -332,7 +332,8 @@ static int rsa_ossl_private_encrypt(int flen, const unsigned char *from,
            goto err;

    if (padding == RSA_X931_PADDING) {
        BN_sub(f, rsa->n, ret);
        if (!BN_sub(f, rsa->n, ret))
            goto err;
        if (BN_cmp(ret, f) > 0)
            res = f;
        else