Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make hash and signature algorithm mapping better. #166

Merged
merged 3 commits into from
Sep 8, 2017
Merged

Conversation

gbrail
Copy link
Contributor

@gbrail gbrail commented Sep 1, 2017

Use a mapping table like the ones that we use for ciphers already
to map "OpenSSL" names to "Java" names. This will make
crypto.createHash and crypto.createSign work more like the way
that Node.js works.

@gbrail gbrail requested a review from whitlockjc September 1, 2017 00:45
Copy link
Member

@whitlockjc whitlockjc left a comment

Choose a reason for hiding this comment

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

Two minor nits, overall: :shipit:

alg = HashAlgorithms.get().getByJavaHashName(nodeAlgorithm);
}
if (alg == null) {
throw Utils.makeError(cx, ctorObj, "Digest method not supported");
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to have the digest at the end of the error? For example: Digest method not supported: fake-algo

@@ -0,0 +1,135 @@
/**
* Copyright 2013 Apigee Corporation.
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be 2017?

Use a mapping table like the ones that we use for ciphers already
to map "OpenSSL" names to "Java" names. This will make
crypto.createHash and crypto.createSign work more like the way
that Node.js works.
Make sure that createSign('sha256') is a valid usage
of this method.
@gbrail gbrail merged commit b073466 into master Sep 8, 2017
@gbrail gbrail deleted the greg-hash-names branch September 8, 2017 18:06
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.

2 participants