From b358cc5882014aefc379ff40794cbfed876627e6 Mon Sep 17 00:00:00 2001 From: Colton Date: Fri, 11 Apr 2014 07:56:41 -0500 Subject: Edit line 59 to remove "mgr" key from #State record. Edit line 133 to expect ok instead of {ok, Pid} from snmpm:start_link . Edit line 136 not to reference Pid variable which was removed above. --- lib/snmp/test/snmp_test_manager.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/snmp/test/snmp_test_manager.erl b/lib/snmp/test/snmp_test_manager.erl index 925ae77ab5..6d8673eecd 100644 --- a/lib/snmp/test/snmp_test_manager.erl +++ b/lib/snmp/test/snmp_test_manager.erl @@ -56,7 +56,7 @@ -export([init/1, handle_call/3, handle_cast/2, handle_info/2, code_change/3, terminate/2]). --record(state, {mgr, parent, req, agent_target_name}). +-record(state, {parent, req, agent_target_name}). -define(SERVER, ?MODULE). -define(USER, ?MODULE). @@ -130,10 +130,10 @@ init([Parent, Opts]) -> do_init(Opts) -> {MgrDir, MgrConf, MgrOpts, AgentTargetName, AgentConf} = parse_opts(Opts), ok = snmp_config:write_manager_config(MgrDir, "", MgrConf), - {ok, Pid} = snmpm:start_link(MgrOpts), + ok = snmpm:start_link(MgrOpts), ok = snmpm:register_user(?USER, ?MODULE, self()), ok = snmpm:register_agent(?USER, AgentTargetName, AgentConf), - {ok, #state{mgr = Pid, agent_target_name = AgentTargetName}}. + {ok, #state{agent_target_name = AgentTargetName}}. parse_opts(Opts) -> -- cgit v1.2.3 From eadc39c5356692d8a093b835d884c8e11faf4c73 Mon Sep 17 00:00:00 2001 From: Colton Date: Fri, 11 Apr 2014 07:56:41 -0500 Subject: Fix badmatch error when trying to start_link an snmp_test_manager Was previously unable to start_link an snmp_test_manager due to a badmatch occurring on line 133. See traceback here: http://pastebin.com/1eNYkGTz Edit snmp_test_manager.erl to only expect the atom ok when it was in turn start_linking an snmpm server. Also remove reference to no longer existing Pid variable. Lastly remove the mgr key from the State record, as after these changes it was no longer being used. --- lib/snmp/test/snmp_test_manager.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/snmp/test/snmp_test_manager.erl b/lib/snmp/test/snmp_test_manager.erl index 925ae77ab5..6d8673eecd 100644 --- a/lib/snmp/test/snmp_test_manager.erl +++ b/lib/snmp/test/snmp_test_manager.erl @@ -56,7 +56,7 @@ -export([init/1, handle_call/3, handle_cast/2, handle_info/2, code_change/3, terminate/2]). --record(state, {mgr, parent, req, agent_target_name}). +-record(state, {parent, req, agent_target_name}). -define(SERVER, ?MODULE). -define(USER, ?MODULE). @@ -130,10 +130,10 @@ init([Parent, Opts]) -> do_init(Opts) -> {MgrDir, MgrConf, MgrOpts, AgentTargetName, AgentConf} = parse_opts(Opts), ok = snmp_config:write_manager_config(MgrDir, "", MgrConf), - {ok, Pid} = snmpm:start_link(MgrOpts), + ok = snmpm:start_link(MgrOpts), ok = snmpm:register_user(?USER, ?MODULE, self()), ok = snmpm:register_agent(?USER, AgentTargetName, AgentConf), - {ok, #state{mgr = Pid, agent_target_name = AgentTargetName}}. + {ok, #state{agent_target_name = AgentTargetName}}. parse_opts(Opts) -> -- cgit v1.2.3 From eee8d83ad1766b038b16102eb2006eaa7c21b4e5 Mon Sep 17 00:00:00 2001 From: Paul Guyot Date: Thu, 15 May 2014 16:29:34 +0200 Subject: Fix bug in SRP implementation SRP didn't work with smaller primes as user secret was improperly computed. Formula is: (B - (k * g^x)) ^ (a + (u * x)) % N Previously, the code computed a + (u * x) % N instead of a + (u * x). a typically is a 256 bits random number (RFC 5054 says it should be at least 256 bits), u and x are SHA1 signatures (160 bits). So a + (u * x) can differ from a + (u * x) % N for N primes smaller than 320 bits. --- lib/crypto/c_src/crypto.c | 4 ++-- lib/crypto/test/crypto_SUITE.erl | 28 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 3020cadc56..a2868850d7 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -2892,8 +2892,8 @@ static ERL_NIF_TERM srp_user_secret_nif(ErlNifEnv* env, int argc, const ERL_NIF_ /* a + (u * x) */ bn_exp2 = BN_new(); - BN_mod_mul(bn_result, bn_u, bn_exponent, bn_prime, bn_ctx); - BN_mod_add(bn_exp2, bn_a, bn_result, bn_prime, bn_ctx); + BN_mul(bn_result, bn_u, bn_exponent, bn_ctx); + BN_add(bn_exp2, bn_a, bn_result); /* (B - (k * g^x)) ^ (a + (u * x)) % N */ BN_mod_exp(bn_result, bn_base, bn_exp2, bn_prime, bn_ctx); diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 479c947029..03aa3964a5 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -690,7 +690,7 @@ group_config(ecdsa = Type, Config) -> SignVerify = [{Type, sha, Public, Private, Msg}], [{sign_verify, SignVerify} | Config]; group_config(srp, Config) -> - GenerateCompute = [srp3(), srp6(), srp6a()], + GenerateCompute = [srp3(), srp6(), srp6a(), srp6a_smaller_prime()], [{generate_compute, GenerateCompute} | Config]; group_config(ecdh, Config) -> Compute = ecdh(), @@ -1496,6 +1496,32 @@ srp6() -> ClientPublic = crypto:mod_pow(Generator, ClientPrivate, Prime), srp(ClientPrivate, Generator, Prime, Version, Verifier, ServerPublic, ServerPrivate, UserPassHash, Scrambler, SessionKey). + +srp6a_smaller_prime() -> + Username = <<"alice">>, + Password = <<"password123">>, + Salt = <<"mystrongsalt">>, + Prime = hexstr2bin("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"), + Generator = <<7>>, + Version = '6a', + Scrambler = hexstr2bin("18DE4A002AD05EF464B19AE2B6929F9B1319C7AA"), + Verifier = hexstr2bin("867401D5DE10964768184EAF246B322760C847604075FA66A4423907" + "8428BCA5"), + ClientPrivate = hexstr2bin("C49F832EE8D67ECF9E7F2785EB0622D8B3FE2344C00F96E1AEF4103C" + "A44D51F9"), + ServerPrivate = hexstr2bin("6C78CCEAAEC15E69068A87795B2A20ED7B45CFC5A254EBE2F17F144A" + "4D99DB18"), + ClientPublic = hexstr2bin("2452A57166BBBF690DB77539BAF9C57CD1ED99D5AA15ED925AD9B5C3" + "64BBEDFF"), + ServerPublic = hexstr2bin("2C0464DE84B91E4963A3546CAC0EFE55F31F49208C3F0AD7EE55F444" + "8F38BA7F"), + + SessionKey = hexstr2bin("65581B2302580BD26F522A5A421CF969B9CCBCE4051196B034A2A9D22065D848"), + UserPassHash = crypto:hash(sha, [Salt, crypto:hash(sha, [Username, <<$:>>, Password])]), + Verifier = crypto:mod_pow(Generator, UserPassHash, Prime), + ClientPublic = crypto:mod_pow(Generator, ClientPrivate, Prime), + srp(ClientPrivate, Generator, Prime, Version, Verifier, ServerPublic, ServerPrivate, UserPassHash, Scrambler, SessionKey). + srp6a() -> Username = <<"alice">>, Password = <<"password123">>, -- cgit v1.2.3 From a933cda32fd2dbae4e1367f98206bebfea39b86b Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sun, 25 May 2014 14:26:08 +0200 Subject: Fix permissions of some files in the repository These files aren't supposed to be executable. For reference, the command used to find them was: git ls-files -z | xargs -0 -J % find % -type f -perm ++x --- erts/emulator/beam/erl_bif_info.c | 0 erts/emulator/beam/global.h | 0 erts/emulator/sys/win32/sys.c | 0 lib/common_test/configure.in | 0 lib/common_test/priv/run_test.in | 0 lib/wx/configure.in | 0 6 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 erts/emulator/beam/erl_bif_info.c mode change 100755 => 100644 erts/emulator/beam/global.h mode change 100755 => 100644 erts/emulator/sys/win32/sys.c mode change 100755 => 100644 lib/common_test/configure.in mode change 100755 => 100644 lib/common_test/priv/run_test.in mode change 100755 => 100644 lib/wx/configure.in diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c old mode 100755 new mode 100644 diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h old mode 100755 new mode 100644 diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c old mode 100755 new mode 100644 diff --git a/lib/common_test/configure.in b/lib/common_test/configure.in old mode 100755 new mode 100644 diff --git a/lib/common_test/priv/run_test.in b/lib/common_test/priv/run_test.in old mode 100755 new mode 100644 diff --git a/lib/wx/configure.in b/lib/wx/configure.in old mode 100755 new mode 100644 -- cgit v1.2.3 From 7b93f5d8a224a0a076a420294c95a666a763ee60 Mon Sep 17 00:00:00 2001 From: Kirill Zaborsky Date: Wed, 28 May 2014 16:55:44 +0400 Subject: ssl: Fix incorrect number of seconds in 24 hours 24 hours in seconds should be equal to 86400 and 86400000 in milliseconds --- lib/ssl/src/ssl_manager.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ssl/src/ssl_manager.erl b/lib/ssl/src/ssl_manager.erl index fbc73e0e42..d6e5064c39 100644 --- a/lib/ssl/src/ssl_manager.erl +++ b/lib/ssl/src/ssl_manager.erl @@ -52,8 +52,8 @@ last_delay_timer = {undefined, undefined}%% Keep for testing purposes }). --define('24H_in_msec', 8640000). --define('24H_in_sec', 8640). +-define('24H_in_msec', 86400000). +-define('24H_in_sec', 86400). -define(GEN_UNIQUE_ID_MAX_TRIES, 10). -define(SESSION_VALIDATION_INTERVAL, 60000). -define(CLEAR_PEM_CACHE, 120000). -- cgit v1.2.3 From a8aee451650d0734350f5af419a9a8ca0dfc8ab7 Mon Sep 17 00:00:00 2001 From: "Matwey V. Kornilov" Date: Sat, 31 May 2014 16:05:27 +0400 Subject: Add correct detection of armv6hl and armv7hl architectures. --- erts/configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erts/configure.in b/erts/configure.in index 04303da4f8..342fab4f7e 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -680,8 +680,10 @@ case $chk_arch_ in armv5teb) ARCH=arm;; armv5tel) ARCH=arm;; armv5tejl) ARCH=arm;; - armv6l) ARCH=arm;; + armv6l) ARCH=arm;; + armv6hl) ARCH=arm;; armv7l) ARCH=arm;; + armv7hl) ARCH=arm;; tile) ARCH=tile;; *) ARCH=noarch;; esac -- cgit v1.2.3 From 8c4b42329f3e25e387a6511f9287c1f2bf8f2c4d Mon Sep 17 00:00:00 2001 From: "Matwey V. Kornilov" Date: Sat, 31 May 2014 16:15:41 +0400 Subject: Add correct detection of powerpc architecture. --- erts/configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/erts/configure.in b/erts/configure.in index 342fab4f7e..f66110b98b 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -673,6 +673,7 @@ case $chk_arch_ in x86_64) ARCH=amd64;; amd64) ARCH=amd64;; macppc) ARCH=ppc;; + powerpc) ARCH=ppc;; ppc) ARCH=ppc;; ppc64) ARCH=ppc64;; "Power Macintosh") ARCH=ppc;; -- cgit v1.2.3