Skip to content

Added app for EVP_KDF - #8762

Closed
slontis wants to merge 4 commits into
openssl:masterfrom
slontis:kdf_app
Closed

slontis wants to merge 4 commits into
openssl:masterfrom
slontis:kdf_app

Conversation

@slontis

@slontis slontis commented Apr 16, 2019

Copy link
Copy Markdown
Member
Checklist
  • documentation is added or updated
  • tests are added or updated

Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
@levitte

levitte commented Apr 16, 2019

Copy link
Copy Markdown
Member

I see your approach with saving all option data first, and only act on them after all arguments have been processed. This is a huge contrast to, for example, openssl genpkey, which acts immediately on the options (which means the options must come in a specific order).

We should probably think about streamlining all apps to behave the same way...

@slontis slontis mentioned this pull request Apr 16, 2019
2 tasks done
@simo5

simo5 commented Apr 16, 2019

Copy link
Copy Markdown

Any reason to leave out SSHKDF from test and docs ?

@slontis

slontis commented Apr 16, 2019 •

Copy link
Copy Markdown
Member Author

I forgot about SSHKDF (I think mainly because the name it looks a lot like SSKDF). Will add.
It was missing from another doc where I got the names from.

@slontis

slontis commented Apr 16, 2019

Copy link
Copy Markdown
Member Author

It appears there is an inconsistency with the kdf docs related to md name. I think David changed it to use 'digest' instead of 'md' (but didnt update the docs).
@simo5 I dont think this PR is the place to do this, but could you fix this up please? There is also a evp_kdf_test.c that SSHKDF should be added to.

Comment thread test/recipes/20-test_kdf.t Resolved
Comment thread doc/man1/kdf.pod Resolved

@tomato42 tomato42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe also add a "see also" to the -kdf algorithm section of pkeyutl(1)?

@simo5

simo5 commented Apr 17, 2019

Copy link
Copy Markdown

It appears there is an inconsistency with the kdf docs related to md name. I think David changed it to use 'digest' instead of 'md' (but didnt update the docs).

Is this referred to sshkdf specifically? If so where do I need to change things?

@simo5 I dont think this PR is the place to do this, but could you fix this up please? There is also a evp_kdf_test.c that SSHKDF should be added to.

Will add a PR shortly that handles this.

@simo5

simo5 commented Apr 17, 2019

Copy link
Copy Markdown

Added evp_kdf_test in #8774

Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
Comment thread doc/man1/kdf.pod Resolved
@slontis slontis mentioned this pull request Apr 18, 2019
1 task done
@slontis

slontis commented Apr 18, 2019 •

Copy link
Copy Markdown
Member Author

Is this referred to sshkdf specifically? If so where do I need to change things?

static int kdf_sshkdf_ctrl_str(EVP_KDF_IMPL *impl, const char *type, const char *value)
{
    if (value == NULL) {
        KDFerr(KDF_F_KDF_SSHKDF_CTRL_STR, KDF_R_VALUE_MISSING);
        return 0;
    }

    if (strcmp(type, "md") == 0)
        return kdf_md2ctrl(impl, kdf_sshkdf_ctrl, EVP_KDF_CTRL_SET_MD, value);

Change it to:

    if (strcmp(type, "digest") == 0)

And then in the tests it needs to be changed (I think its mainly in evpdigest.txt)

Also add to test/recipies/20-test_kdf.t (After this PR is merged)

@slontis

slontis commented Apr 18, 2019 •

Copy link
Copy Markdown
Member Author

maybe also add a "see also" to the -kdf algorithm section of pkeyutl(1)?
I think this should be in a seperate PR if it is done.

I see your approach with saving all option data first, and only act on them after all arguments have been processed. This is a huge contrast to, for example, openssl genpkey, which acts immediately on the options (which means the options must come in a specific order).

We should probably think about streamlining all apps to behave the same way...

Hmm - well I dont currently process them individually, so the order of the options is still the read in order i.e. the order they are added to the list.

@simo5

simo5 commented Apr 18, 2019

Copy link
Copy Markdown

Is this referred to sshkdf specifically? If so where do I need to change things?

static int kdf_sshkdf_ctrl_str(EVP_KDF_IMPL *impl, const char *type, const char *value)
{
    if (value == NULL) {
        KDFerr(KDF_F_KDF_SSHKDF_CTRL_STR, KDF_R_VALUE_MISSING);
        return 0;
    }

    if (strcmp(type, "md") == 0)
        return kdf_md2ctrl(impl, kdf_sshkdf_ctrl, EVP_KDF_CTRL_SET_MD, value);

Change it to:

    if (strcmp(type, "digest") == 0)

And then in the tests it needs to be changed (I think its mainly in evpdigest.txt)

Also add to test/recipies/20-test_kdf.t (After this PR is merged)

I did leave "md" as alias so that tests do not need to be changed, but I can change them if requested on the new PR.

I'll add a not to change 20-test_kdf.t before merging

@tomato42

tomato42 commented Apr 18, 2019 •

Copy link
Copy Markdown
Contributor

maybe also add a "see also" to the -kdf algorithm section of pkeyutl(1)?

I think this should be in a seperate PR if it is done.

filed #8784

@slontis

slontis commented Apr 23, 2019

Copy link
Copy Markdown
Member Author

ping

levitte
levitte previously approved these changes Apr 23, 2019

@levitte levitte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yup

@levitte levitte added this to the 3.0.0 milestone Apr 23, 2019
@levitte levitte added the approval: review pending This pull request needs review by a committer label Apr 23, 2019
@t-j-h t-j-h 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 Apr 23, 2019
@levitte
levitte dismissed their stale review April 23, 2019 08:58

Missing entry in CHANGES and NEWS

@levitte

levitte commented Apr 23, 2019

Copy link
Copy Markdown
Member

While looking at this, I realised this warrants an entry in NEWS and in CHANGES. My approval is withdrawn until they appear.

@slontis

slontis commented Apr 23, 2019

Copy link
Copy Markdown
Member Author

While looking at this, I realised this warrants an entry in NEWS and in CHANGES. My approval is withdrawn until they appear.

Updated those docs (added mac application entries also)

@levitte

levitte commented Apr 23, 2019

Copy link
Copy Markdown
Member

Sorry to nag, but there's a need for a rebase...

@levitte

levitte commented Apr 24, 2019

Copy link
Copy Markdown
Member

Merged.

07822c5 added openssl app 'kdf' and 'mac' to the NEWS and CHANGES docs
c54492e Added app for EVP_KDF

@levitte levitte closed this Apr 24, 2019
levitte pushed a commit that referenced this pull request Apr 24, 2019
Reviewed-by: Tim Hudson <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from #8762)
levitte pushed a commit that referenced this pull request Apr 24, 2019
Reviewed-by: Tim Hudson <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from #8762)
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants