Skip to content

CAPI engine: add support for RSA_NO_PADDING [master / 1.1.1, 1.1.0]#7174

Closed
levitte wants to merge 1 commit intoopenssl:masterfrom
levitte:fix-e_capi-20180906-master
Closed

CAPI engine: add support for RSA_NO_PADDING [master / 1.1.1, 1.1.0]#7174
levitte wants to merge 1 commit intoopenssl:masterfrom
levitte:fix-e_capi-20180906-master

Conversation

@levitte
Copy link
Member

@levitte levitte commented Sep 11, 2018

Since the SSL code started using RSA_NO_PADDING, the CAPI engine became
unusable. This change fixes that.

Fixes #7131


This is a port of #7132, which unfortunately didn't cherry-pick cleanly to master

Since the SSL code started using RSA_NO_PADDING, the CAPI engine became
unusable.  This change fixes that.

Fixes openssl#7131
@levitte levitte added branch: master Applies to master branch 1.1.0 branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL) labels Sep 11, 2018
@mattcaswell mattcaswell added the approval: done This pull request has the required number of approvals label Sep 11, 2018
levitte added a commit that referenced this pull request Sep 11, 2018
Since the SSL code started using RSA_NO_PADDING, the CAPI engine became
unusable.  This change fixes that.

Fixes #7131

Reviewed-by: Tim Hudson <[email protected]>
Reviewed-by: Matt Caswell <[email protected]>
(Merged from #7174)

(cherry picked from commit 37f4928)
@mattcaswell
Copy link
Member

Pushed.

levitte added a commit that referenced this pull request Sep 11, 2018
Since the SSL code started using RSA_NO_PADDING, the CAPI engine became
unusable.  This change fixes that.

Fixes #7131

Reviewed-by: Tim Hudson <[email protected]>
Reviewed-by: Matt Caswell <[email protected]>
(Merged from #7174)
if (!CryptDecrypt(capi_key->key, 0, TRUE, flags, tmpbuf, &dlen)) {
CAPIerr(CAPI_F_CAPI_RSA_PRIV_DEC, CAPI_R_DECRYPT_ERROR);
capi_addlasterror();
OPENSSL_cleanse(tmpbuf, dlen);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for not using OPENSSL_clear_free() here rather than keeping OPENSSL_free() and adding an explicit OPENSSL_cleanse()?

} else {
memcpy(to, tmpbuf, (flen = (int)dlen));
}
OPENSSL_cleanse(tmpbuf, flen);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here regarding use of OPENSSL_clear_free() rather than OPENSSL_cleanse()

@stevelinsell
Copy link
Contributor

Sorry observation too late :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: done This pull request has the required number of approvals branch: master Applies to master branch branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CryptoAPI ENGINE (capi) unusable since 1.0.2m due to RSA_NO_PADDING

4 participants