Skip to content

Comments

Test Rsa oaep in fips mode#11948

Closed
slontis wants to merge 4 commits intoopenssl:masterfrom
slontis:rsa_oaep_test
Closed

Test Rsa oaep in fips mode#11948
slontis wants to merge 4 commits intoopenssl:masterfrom
slontis:rsa_oaep_test

Conversation

@slontis
Copy link
Member

@slontis slontis commented May 25, 2020

Checklist
  • documentation is added or updated
  • tests are added or updated

@slontis slontis added branch: master Applies to master branch approval: review pending This pull request needs review by a committer labels May 25, 2020
@slontis slontis force-pushed the rsa_oaep_test branch 2 times, most recently from 75116b0 to 208c35c Compare May 25, 2020 04:54
@slontis slontis force-pushed the rsa_oaep_test branch 2 times, most recently from 107c56d to 2cefc57 Compare May 26, 2020 06:49
@slontis slontis mentioned this pull request May 27, 2020
2 tasks
@slontis slontis force-pushed the rsa_oaep_test branch 2 times, most recently from 6a037c2 to 84ed2af Compare May 28, 2020 01:56
@slontis slontis changed the title Fix Rsa oaep in fips mode Test Rsa oaep in fips mode May 28, 2020
@slontis
Copy link
Member Author

slontis commented May 28, 2020

Updated docs.

@levitte
Copy link
Member

levitte commented May 28, 2020

On a per-command basis, I'm not sure I like the whole library context fiddling, at all. It seems... unnecessary.

Note, though, that I don't think that a library context per se is unnecessary, but it should be made on a global level. Think of the interactive mode, where we currently have each command affecting the rest regarding libcrypto global data. If each command was executed within its own library context, the problem of one command affecting the next should ultimately go away.

Remains electively loading the null provider into the default provider... I assume that's an interim thing, to purposefully make things break if they rely on the default library context when they shouldn't. I'm not sure I'd make that subject of a per-command option, but rather of an environment variable (mostly because we don't have global options). OPENSSL_NO_DEFAULT_CONTEXT maybe?

I've had a global app library context in the back of my mind for a while, so I have ideas (but for once, not a branch yet). Do you want to tackle that or shall I?

@slontis
Copy link
Member Author

slontis commented May 28, 2020

I would like to see less environment variables, not more of them :)
Putting the null provider into the default context and using the fips provider in a created library context is a fundamental requirement. The library context was introduced to solve a particular problem. Using the fips provider in the default library context is avoiding the issue that the library context was added for.

@slontis
Copy link
Member Author

slontis commented May 28, 2020

As I just discovered with pkeyutl a library context is going to break certain operations that are not currently compatible (such as SM2). Which is why I went with the per command -use_libctx option.

@levitte
Copy link
Member

levitte commented May 28, 2020

I would like to see less environment variables, not more of them :)

Yes, me too, but I would like even less to see interim / unnecessary options

Putting the null provider into the default context and using the fips provider in a created library context is a fundamental requirement.

Er, what??? Why?

The library context was introduced to solve a particular problem. Using the fips provider in the default library context is avoiding the issue that the library context was added for.

Yes, almost everything that's currently global in libcrypto should move to be stored in a library context, and we're currently not there. That's the reason I'm calling all these new options "interim", because as soon as we've finished that move, they will not be necessary any more. That's also why I seriously question the "fundamental requirement" that the FIPS provider must be loaded in a non-default provider... it sounds much more like a band-aid than a "fundamental requirement".

@slontis slontis removed the hold: discussion The community needs to establish a consensus how to move forward with the issue or PR label Jun 15, 2020
@slontis
Copy link
Member Author

slontis commented Jun 15, 2020

@levitte. I have updated the code.
I need the 'use_libctx' option to test this as well as any other fips tests (see CMS). So even though it is 'just for testing'. It needs to always be there in order to do the tests. So this is not really a temporary config option.

I have reused -config instead of using provider_config (but this also now loads any modules).

@slontis
Copy link
Member Author

slontis commented Jun 15, 2020

The size of PR #11884 is getting quite large - so I have tried to separate out some bits into smaller PR's to make it easier to review.

@slontis
Copy link
Member Author

slontis commented Jun 26, 2020

ping @levitte

I have multiple PR's that rely on testing using a extra libctx from the apps.

@slontis
Copy link
Member Author

slontis commented Jul 9, 2020

ping @levitte

2 similar comments
@slontis
Copy link
Member Author

slontis commented Jul 14, 2020

ping @levitte

@slontis
Copy link
Member Author

slontis commented Jul 20, 2020

ping @levitte

@slontis
Copy link
Member Author

slontis commented Jul 22, 2020

Changed apps to use an environment variable 'OPENSSL_TEST_LIBCTX'
instead of the -use_libctx option.

@levitte or @mattcaswell - can someone review please.

@levitte levitte added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Jul 22, 2020
slontis added 4 commits July 22, 2020 17:03
Added RSA oaep test that uses pkeyutl.
Added openssl application options to support loading a fips provider into a library context ('-use_libctx' and -'provider_config')
@slontis
Copy link
Member Author

slontis commented Jul 22, 2020

Needed to rebase and remove the default options for tests call to fipsinstall.

Copy link
Member

@levitte levitte left a comment

Choose a reason for hiding this comment

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

Ok

@richsalz
Copy link
Contributor

you could have left the redundant default flags, as a test. When I added the defaults, I deliberately did that in one test.

@slontis
Copy link
Member Author

slontis commented Jul 22, 2020

Either way.. having hexkey:00 was not good though :)

@slontis
Copy link
Member Author

slontis commented Jul 22, 2020

Wow the tests ran without a timeout...

@openssl-machine
Copy link
Collaborator

24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually.

@slontis slontis added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels Jul 23, 2020
openssl-machine pushed a commit that referenced this pull request Jul 23, 2020
Added RSA oaep test that uses the pkeyutl application.
Added an openssl application option to support loading a (fips) provider via the '-config' option.
Added openssl application related environment variable 'OPENSSL_TEST_LIBCTX' (for testing purposes only),
that creates a non default library context.

Reviewed-by: Richard Levitte <[email protected]>
(Merged from #11948)
@slontis
Copy link
Member Author

slontis commented Jul 23, 2020

Thanks.. Merged to master.

@slontis slontis closed this Jul 23, 2020
@slontis slontis mentioned this pull request Jul 23, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Applies to master branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants