You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original reporter: sdl.web@gmail.com
Affected version: OTP-21.3
Fixed in version: OTP-22.1
Component: public_key
Migrated from: https://bugs.erlang.org/browse/ERL-915
The spec says first argument is string() but it crashes with badarg when given any thing larger than 255. BTW, is is possible to provide a public API for pbdkdf2?
{code:erlang}
-spec pbdkdf2(string(), iodata(), integer(), integer(), fun(), atom(), integer())
-> binary().
%%
%% Description: Implements password based decryption key derive function 2.
%% Exported mainly for testing purposes.
%%--------------------------------------------------------------------
pbdkdf2(Password, Salt, Count, DerivedKeyLen, Prf, PrfHash, PrfOutputLen)->
NumBlocks = ceiling(DerivedKeyLen / PrfOutputLen),
NumLastBlockOctets = DerivedKeyLen - (NumBlocks - 1) * PrfOutputLen ,
blocks(NumBlocks, NumLastBlockOctets, 1, Password, Salt,
Count, Prf, PrfHash, PrfOutputLen, <<>>).
{code}
The text was updated successfully, but these errors were encountered:
Without checking, I would say that it is only a sub type of string() that will actually work for this function. We will look into that. It would be possible to have a public API for password based encryption functions, we have thought of doing it, but it has never been prioritized high enough.
Once you make a function public, it is hard to change, so we like it to be thought through. You are welcome to make a PR if you have a suggestion.
Original reporter:
sdl.web@gmail.com
Affected version:
OTP-21.3
Fixed in version:
OTP-22.1
Component:
public_key
Migrated from: https://bugs.erlang.org/browse/ERL-915
The text was updated successfully, but these errors were encountered: