-
Notifications
You must be signed in to change notification settings - Fork 125
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
Add brainpoolP256r1 curve support #421
base: master
Are you sure you want to change the base?
Conversation
lib/algorithms/helpers.js
Outdated
} | ||
|
||
try { | ||
promise = Promise.resolve(nodejs.apply(null, args)); | ||
promise = promise.catch(check); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nodejs.apply(null, args)
is a synchronous operation so i think this statement is unreachable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaccenture good point! nodejs.apply
is a synchronous function that can throw
. However, it also returns a promise that can reject
. Hence we need to both wrap the call in a try/catch, and call promise.catch
here. I'll add a comment to clarify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the link, I saw return Promise.reject()
so this catch here save us from unhandled promise rejection. Legitimate.
The brainpoolP256r1 curve is defined in RFC 5639, and is a recommended standard (PDF) by the German Ministry for Information Security. This curve is used in several of the German healthcare system's digitization standards (PDF; and also in German, sorry) for authenticating with various specialist services.