Skip to content

Offer PBE key streching via command line app - #318

Closed
johndoe31415 wants to merge 4222 commits into
openssl:masterfrom
johndoe31415:master
Closed

johndoe31415 wants to merge 4222 commits into
openssl:masterfrom
johndoe31415:master

Conversation

@johndoe31415

Copy link
Copy Markdown
Contributor

The key streching functions PBKDF2 and scrypt currently do not have any
way of performing key derivation via the command line interface. This
patch adds an app called "pbe" which offers this functionality.

@richsalz

richsalz commented Jul 1, 2015

Copy link
Copy Markdown
Contributor

This is a nice patch, well done. I'll work on getting it into master soon.

@johndoe31415

Copy link
Copy Markdown
Contributor Author

Hey Rich,

thank you very much :-) I think it'd be really cool if this were merged, it's one of the very very few features I'm missing from OpenSSL at the moment.

And I also wanted to try out the new development process with GitHub. Absolutely love the direction OpenSSL is going. Keep up the great work.

Best regards,
Johannes

@richsalz

Copy link
Copy Markdown
Contributor

Someone on the team is thinking about being able to treat PBE's as KDF, and being able to generalize. So this is on hold for now.

@johndoe31415

Copy link
Copy Markdown
Contributor Author

Hi Rich,

hm, I'd argue against putting it into the KDF routines (i.e. "openssl dgst"). I thought about it when implementing the PBE and my reasoning was that "dgst" already is horribly bloated: It handles digests, signatures and MAC. While they all rely on cryptographic hash functions in their bellies, each are very different beasts. As is PBE, in my opinion.

However, if the "dgst" facility would see a major overhaul, that would even have the great benefit of making it easier to use (and then it would also maybe be possible to cleanly integrate PBE). If you refer me to the discussion thread, I'd like to participate in the talks, I'm subscribed to openssl-user :-)

Best regards,
Johannes

@levitte

levitte commented May 4, 2016

Copy link
Copy Markdown
Member

Hmmm... @richsalz, your remark back in January, how did that all play out? Is this PR still relevant?

@richsalz

richsalz commented May 4, 2016

Copy link
Copy Markdown
Contributor

Nothing ever happened; Henson didn't review.

@mattcaswell mattcaswell added this to the Post 1.1.0 milestone May 5, 2016
@johndoe31415

Copy link
Copy Markdown
Contributor Author

Hi there, I'd still like to contribute since it's a feature I find important and one that I'd like to push forward. Is there anything that I can contribute that would make sense? Any discussion or modification of the PR to work against latest master? Please let me know. Thanks, Joe

@richsalz

Copy link
Copy Markdown
Contributor

Perhaps start some discussion on openssl-dev as a post-1.1 feature.

snhenson and others added 19 commits August 13, 2016 14:11
Add ctrl operations to set or retrieve encoded point in
EVP_PKEY structures containing X25519 keys.

Reviewed-by: Rich Salz <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
Add encoded point ctrl support for other curves: this makes it possible
to handle X25519 and other EC curve point encoding in a similar way
for TLS.

Reviewed-by: Rich Salz <[email protected]>
When handling ECDH check to see if the curve is "custom" (X25519 is
currently the only curve of this type) and instead of setting a curve
NID just allocate a key of appropriate type.

Reviewed-by: Rich Salz <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
Reviewed-by: Tim Hudson <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
(Merged from #1455)
Fix no-ec builds by having separate functions to create keys based on
an existing EVP_PKEY and a curve id.

Reviewed-by: Rich Salz <[email protected]>
Changes them to have clearer ownership semantics, as suggested in
#1372 (comment).

Reviewed-by: Emilia Käsper <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
(Merged from #1408)
They may fail if they cannot increment the reference count of the
certificate they are storing a pointer for. They should return 0 if this
occurs.

Reviewed-by: Emilia Käsper <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
(Merged from #1408)
…o.num

Reviewed-by: Emilia Käsper <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
(Merged from #1408)
Feedback on the previous SSLv2 ClientHello processing fix was that it
breaks layering by reading init_num in the record layer. It also does not
detect if there was a previous non-fatal warning.

This is an alternative approach that directly tracks in the record layer
whether this is the first record.

GitHub Issue #1298

Reviewed-by: Tim Hudson <[email protected]>
If we receive a non-initial record but the version number isn't right then
we should send an alert.

Reviewed-by: Tim Hudson <[email protected]>
Test that we handle a TLS ClientHello in an SSLv2 record correctly.

Reviewed-by: Tim Hudson <[email protected]>
Because some targets execute perl code that might die, we risk
incomplete lists.  Make it so dying doesn't happen when we're listing
targets.

Reviewed-by: Rich Salz <[email protected]>
@richsalz richsalz removed the hold label Sep 1, 2016
@richsalz

richsalz commented Sep 1, 2016

Copy link
Copy Markdown
Contributor

+1

@richsalz richsalz self-assigned this Sep 1, 2016
@richsalz

richsalz commented Sep 1, 2016

Copy link
Copy Markdown
Contributor

can you rebase against 1.1.0 and push an update?

levitte and others added 14 commits September 1, 2016 20:58
So far, the test runner (test/run_tests.pl) could get a list of tests
to run, and if non were given, it assumes all available tests should
be performed.

However, that makes skipping just one or two tests a bit of a pain.
This change makes the possibilities more versatile, run_checker.pl
takes these arguments and will process them in the given order,
starting with an empty set of tests to perform:

    alltests            The current set becomes the whole set of
                        available tests.
    test_xxx            Adds 'test_xxx' to the current set.
    -test_xxx           Removes 'test_xxx' from the current set.  If
                        nothing has been added to the set before this
                        argument, the current set is first initialised
                        to the whole set of available tests, then
                        'test_xxx' is removed from the current set.
    list                Display all available tests, then stop.

If no arguments are given, 'alltests' is assumed.

Reviewed-by: Emilia Käsper <[email protected]>
This reverts commit eb40eae.

Reviewed-by: Emilia Käsper <[email protected]>
This adheres much better to the documentation in test/README

Reviewed-by: Rich Salz <[email protected]>
Since vendor assembler can't assemble our modules with -KPIC flag,
it, assembly support, was not available as an option. But this
means lack of side-channel resistant code, which is incompatible
with security by todays standards.

Reviewed-by: Rich Salz <[email protected]>
MIPS[32|64]R6 is binary and source incompatible with previous MIPS ISA
specifications. Fortunately it's still possible to resolve differences
in source code with standard pre-processor and switching to trap-free
version of addition and subtraction instructions.

Reviewed-by: Richard Levitte <[email protected]>
The key streching functions PBKDF2 and scrypt currently do not have any
way of performing key derivation via the command line interface. This
patch adds an app called "pbe" which offers this functionality.
@johndoe31415

johndoe31415 commented Sep 4, 2016 •

Copy link
Copy Markdown
Contributor Author

Hi Rich,

just rebased against openssl/master and also did some refactoring (i.e., used OpenSSL-specific option parsing instead of doing custom stuff). However I think I messed up something in the rebase, the whole PR now looks awful. Should I start fresh and put in a new PR or is this something you can work with? Sorry for the trouble, I'm not sure where I took a wrong turn :-(

Another thing I added was support for OPENSSL_NO_SCRYPT. Builds fine without scrypt now and all messages (e.g., help page) are updated accordingly.

Cheers,
Johannes

@richsalz

richsalz commented Sep 4, 2016

Copy link
Copy Markdown
Contributor

Sure, close and start from scratch. No problem!

@johndoe31415

Copy link
Copy Markdown
Contributor Author

Closing so I can reopen this PR.

johndoe31415 added a commit to johndoe31415/openssl that referenced this pull request Jul 21, 2017
Squashed commits of the rejected PR archived here. For discussion on
this, see

openssl#318
and openssl#1533

Code in its current form does not work. Archival purposes only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.