diff options
author | Ingela Anderton Andin <[email protected]> | 2013-05-03 10:20:37 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2013-05-08 10:39:22 +0200 |
commit | cb1305212e71855890bbfb0a509a007543529d24 (patch) | |
tree | f37e9017efdb10d43f9439f490709e460573aef6 /lib/ssl/src | |
parent | a9add4e3d878bbd339fc2bb36e97d1053318b4e6 (diff) | |
download | otp-cb1305212e71855890bbfb0a509a007543529d24.tar.gz otp-cb1305212e71855890bbfb0a509a007543529d24.tar.bz2 otp-cb1305212e71855890bbfb0a509a007543529d24.zip |
ssl & crypto: Generalize the remaining crypto API
Diffstat (limited to 'lib/ssl/src')
-rw-r--r-- | lib/ssl/src/ssl_cipher.erl | 4 | ||||
-rw-r--r-- | lib/ssl/src/ssl_connection.erl | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index 5ce1350f09..accea63344 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -77,7 +77,7 @@ cipher(?RC4, CipherState, Mac, Fragment, _Version) -> S -> S end, GenStreamCipherList = [Fragment, Mac], - {State1, T} = crypto:stream_encrypt(rc4, State0, GenStreamCipherList), + {State1, T} = crypto:stream_encrypt(State0, GenStreamCipherList), {T, CipherState#cipher_state{state = State1}}; cipher(?DES, CipherState, Mac, Fragment, Version) -> block_cipher(fun(Key, IV, T) -> @@ -130,7 +130,7 @@ decipher(?RC4, HashSz, CipherState, Fragment, _) -> undefined -> crypto:stream_init(rc4, CipherState#cipher_state.key); S -> S end, - try crypto:stream_decrypt(rc4, State0, Fragment) of + try crypto:stream_decrypt(State0, Fragment) of {State, Text} -> GSC = generic_stream_cipher_from_bin(Text, HashSz), #generic_stream_cipher{content = Content, mac = Mac} = GSC, diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index eb2fc5467d..54eed03d3c 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -2188,7 +2188,7 @@ handle_srp_identity(Username, {Fun, UserState}) -> {ok, {SRPParams, Salt, DerivedKey}} when is_atom(SRPParams), is_binary(Salt), is_binary(DerivedKey) -> {Generator, Prime} = ssl_srp_primes:get_srp_params(SRPParams), - Verifier = crypto:mod_exp_prime(Generator, DerivedKey, Prime), + Verifier = crypto:mod_pow(Generator, DerivedKey, Prime), #srp_user{generator = Generator, prime = Prime, salt = Salt, verifier = Verifier}; #alert{} = Alert -> |