Support OTP >=24#253
Conversation
remove rebar_ct
updated using https
# Conflicts: # rebar.config
| hi(Password, Salt, Iterations) -> | ||
| {ok, Key} = pbkdf2:pbkdf2(sha, Password, Salt, Iterations, 20), | ||
| Key. | ||
| crypto:pbkdf2_hmac(sha, Password, Salt, Iterations, 20). |
There was a problem hiding this comment.
We probably want to follow the pattern in #232 to avoid breaking the library on older releases of OTP. That is, crypto:pbkdf2_hmac is new in OTP 24 and missing from older versions, so if we run this patch on OTP 23 we'll crash for the same reason this fix exists.
Checking for OTP version
mongodb-erlang/src/support/mc_utils.erl
Lines 14 to 19 in 5881a8b
Conditionally using newer functions
mongodb-erlang/src/support/mc_utils.erl
Lines 75 to 79 in 5881a8b
There was a problem hiding this comment.
updated, didn't know crypto in OTP < 24 doesn't have pbkdf2_hmac, thanks for the info
There was a problem hiding this comment.
My read on the docs is that it came in with OTP 24.2, with crypto 5.0.5
Come to think of it, do we need to check for 24.2 even? I guess OTP 24.0 and OTP 24.1 won't have it either. I'm not sure off-hand how to check for the minor version and I hope we can do it in the macro so this doesn't have to be a runtime check.
There was a problem hiding this comment.
I couldn't find a predefined macro returns the minor/patch version
There was a problem hiding this comment.
I couldn't find a predefined macro returns the minor/patch version
No description provided.