diff options
author | Dan Gudmundsson <[email protected]> | 2010-06-07 13:01:36 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-06-07 15:37:41 +0200 |
commit | a474f5b2c85c80e1b97df731d973e66faf76cec5 (patch) | |
tree | 69db8f4d7ada2da3402bdeb1d60994eafad00bb1 | |
parent | 23fbb26b04921f98c78c600506fa754914f76af2 (diff) | |
download | otp-a474f5b2c85c80e1b97df731d973e66faf76cec5.tar.gz otp-a474f5b2c85c80e1b97df731d973e66faf76cec5.tar.bz2 otp-a474f5b2c85c80e1b97df731d973e66faf76cec5.zip |
Public key test fixes
-rw-r--r-- | lib/public_key/test/pkey_test.erl | 2 | ||||
-rw-r--r-- | lib/public_key/test/public_key_SUITE.erl | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/public_key/test/pkey_test.erl b/lib/public_key/test/pkey_test.erl index 9d596eee4f..4cf20f0174 100644 --- a/lib/public_key/test/pkey_test.erl +++ b/lib/public_key/test/pkey_test.erl @@ -271,7 +271,7 @@ publickey(#'DSAPrivateKey'{p=P, q=Q, g=G, y=Y}) -> #'OTPSubjectPublicKeyInfo'{algorithm = Algo, subjectPublicKey = Y}. validity(Opts) -> - DefFrom0 = date(), + DefFrom0 = calendar:gregorian_days_to_date(calendar:date_to_gregorian_days(date())-1), DefTo0 = calendar:gregorian_days_to_date(calendar:date_to_gregorian_days(date())+7), {DefFrom, DefTo} = proplists:get_value(validity, Opts, {DefFrom0, DefTo0}), Format = fun({Y,M,D}) -> lists:flatten(io_lib:format("~w~2..0w~2..0w000000Z",[Y,M,D])) end, diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl index 6a3d6bfcf5..dc1015969a 100644 --- a/lib/public_key/test/public_key_SUITE.erl +++ b/lib/public_key/test/public_key_SUITE.erl @@ -320,12 +320,12 @@ pkix_path_validation(Config) when is_list(Config) -> {org_unit, "testing dep"} ]} ]), - ok = pkey_test:write_pem("/tmp", "cacert", CaK), + ok = pkey_test:write_pem("./", "public_key_cacert", CaK), CertK1 = {Cert1, _} = pkey_test:make_cert([{issuer, CaK}]), CertK2 = {Cert2,_} = pkey_test:make_cert([{issuer, CertK1}, {digest, md5}, {extensions, false}]), - ok = pkey_test:write_pem("/tmp", "cert", CertK2), - + ok = pkey_test:write_pem("./", "public_key_cert", CertK2), + {ok, _} = public_key:pkix_path_validation(Trusted, [Cert1], []), {error, {bad_cert,invalid_issuer}} = public_key:pkix_path_validation(Trusted, [Cert2], []), |