Skip to content

PROV: add RSA signature implementation#10557

Merged
openssl-machine merged 7 commits intoopenssl:masterfrom
levitte:add-rsa-signature
Feb 22, 2020
Merged

PROV: add RSA signature implementation#10557
openssl-machine merged 7 commits intoopenssl:masterfrom
levitte:add-rsa-signature

Conversation

@levitte
Copy link
Member

@levitte levitte commented Dec 2, 2019

This is almost an exact copy of the DSA implementation, except we need
to pass the MD type to RSA_sign() and RSA_verify() (the corresponding
DSA functions don't care).

@levitte levitte added branch: master Applies to master branch approval: review pending This pull request needs review by a committer labels Dec 2, 2019
@levitte levitte requested a review from mattcaswell December 2, 2019 10:27
@mattcaswell
Copy link
Member

I get large numbers of test failures when I try this locally. Still investigating, however I'm surprised not to see any handling of EVP_PKEY_CTX_set_rsa_pss_saltlen() in this PR (and possibly other similar ctrls) - so that could be a cause??

@mattcaswell
Copy link
Member

...in fact no handling of pss at all AFAICT?

@levitte
Copy link
Member Author

levitte commented Dec 2, 2019

Yup, PSS support remains to be done on the provider side. But I'm surprised that actually fails, because that should go to the legacy routines, since RSASSA-PSS is supposedly treated as a separate algorithm!

@levitte
Copy link
Member Author

levitte commented Dec 2, 2019

There seems to be more going on. I recognise the 'test_req` failures from my keygen work (I've a local fix there, and wonder if the same applies here)

@levitte
Copy link
Member Author

levitte commented Dec 2, 2019

... since RSASSA-PSS is supposedly treated as a separate algorithm!

... 'xcept no, that's not at all true. test_rsapss.t uses "normal" RSA keys and adds PSS parameters for signing. Oh boy...

@levitte levitte changed the title PROV: add RSA signature implementation [WIP] PROV: add RSA signature implementation Dec 2, 2019
@levitte
Copy link
Member Author

levitte commented Dec 2, 2019

I put this in WIP, it needs further work

@richsalz
Copy link
Contributor

richsalz commented Dec 2, 2019

This is almost an exact copy of the DSA implementation, except we need
to pass the MD type to RSA_sign() and RSA_verify() (the corresponding
DSA functions don't care).

Can you pass the extra parameter to the DSA functions and have them ignore it? Or is there current API's that get in the way of doing that? (I'm hoping that the PARAM layer can just ignore things, e.g.)

@levitte
Copy link
Member Author

levitte commented Dec 2, 2019

It wasn't as easy as I thought

@levitte
Copy link
Member Author

levitte commented Dec 3, 2019

Almost there. As usual, the CMS test is the last stumbling block...

@levitte
Copy link
Member Author

levitte commented Dec 3, 2019

Now, even CMS passes through on my machine. It turned out that I had forgotten to take care of PSS_SALTLEN params

Copy link
Member

@mattcaswell mattcaswell left a comment

Choose a reason for hiding this comment

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

Looking good...

@mattcaswell
Copy link
Member

Is this out of WIP now?

@levitte levitte changed the title [WIP] PROV: add RSA signature implementation PROV: add RSA signature implementation Dec 3, 2019
@levitte
Copy link
Member Author

levitte commented Dec 3, 2019

Is this out of WIP now?

Yes

@levitte
Copy link
Member Author

levitte commented Dec 3, 2019

I think I've addressed all reviewing comments so far.

@levitte
Copy link
Member Author

levitte commented Dec 3, 2019

Anything else? The CIs seem happy

@levitte
Copy link
Member Author

levitte commented Dec 3, 2019

... or not. Damn github delayed update...

@levitte
Copy link
Member Author

levitte commented Feb 19, 2020

There was a missing check. Travis will hopefully be happier now.

Copy link
Member

@slontis slontis left a comment

Choose a reason for hiding this comment

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

provided appveyor passes

@levitte
Copy link
Member Author

levitte commented Feb 19, 2020

All CIs are happy

@levitte
Copy link
Member Author

levitte commented Feb 19, 2020

@t8m, does your approval still stand? Things have happened since, so perhaps a re-approval would be safer?

@levitte levitte added the approval: done This pull request has the required number of approvals label Feb 19, 2020
Copy link
Member

@t8m t8m left a comment

Choose a reason for hiding this comment

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

Some questions and nits.

@t8m
Copy link
Member

t8m commented Feb 20, 2020

And there is merge conflict now.

@levitte
Copy link
Member Author

levitte commented Feb 20, 2020

And there is merge conflict now.

Damnit!

@levitte
Copy link
Member Author

levitte commented Feb 20, 2020

At least, it wasn't a conflict I had caused myself 😉

@t8m
Copy link
Member

t8m commented Feb 20, 2020

Now there is a travis failure and there seem to be some deprecated declarations warnings as well in the build logs.

@levitte
Copy link
Member Author

levitte commented Feb 20, 2020

Ah, right! Totally forgot that part

@levitte
Copy link
Member Author

levitte commented Feb 20, 2020

Travis failure is just the usual timeout...

Copy link
Member

@t8m t8m left a comment

Choose a reason for hiding this comment

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

Good work!

@levitte
Copy link
Member Author

levitte commented Feb 21, 2020

I'll merge later tonight, or tomorrow morning

This includes legacy PSS controls to params conversion, and an attempt
to generalise the parameter names when they are suitable for more than
one operation.

Also added crypto/rsa/rsa_aid.c, containing proper AlgorithmIdentifiers
for known RSA+hash function combinations.

Reviewed-by: Shane Lontis <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#10557)
Reviewed-by: Shane Lontis <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#10557)
Reviewed-by: Shane Lontis <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#10557)
Tests that go through provider cannot recognise PKEY_CTRL_INVALID from
PKEY_CTRL_ERROR any more, because provided implementations' param
setting functions return 0 or 1.

Reviewed-by: Shane Lontis <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#10557)
Clean up a manual we've touched, according to conventions found in
Linux' man-pages(7); function arguments in descriptions should be in
italics, and types, macros and similar should be in bold, with the
exception for NULL.

Reviewed-by: Shane Lontis <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#10557)
Made macro names that refer to a known base OID, an commented accordingly.

Reviewed-by: Shane Lontis <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#10557)
@openssl-machine openssl-machine merged commit 8e90e3d into openssl:master Feb 22, 2020
@levitte
Copy link
Member Author

levitte commented Feb 22, 2020

Done

@t8m
Copy link
Member

t8m commented Feb 26, 2020

This regressed MD5-SHA1 signatures.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants