diff options
author | msvensson@neptunus.(none) <> | 2007-01-22 16:54:40 +0100 |
---|---|---|
committer | msvensson@neptunus.(none) <> | 2007-01-22 16:54:40 +0100 |
commit | 1ebe4850d6330665cf9ad0c71bf41f468fff8a47 (patch) | |
tree | 08fda0eefd85407c1dbb0a9146b04d09c0cd6f8a /extra/yassl/taocrypt/test/test.cpp | |
parent | 4bb6151a7a64038f45c19c7bcb0dba22b2bab6bc (diff) | |
download | mariadb-git-1ebe4850d6330665cf9ad0c71bf41f468fff8a47.tar.gz |
Import yaSSL version 1.5.8
- Includes patch for Bug#25189
Diffstat (limited to 'extra/yassl/taocrypt/test/test.cpp')
-rw-r--r-- | extra/yassl/taocrypt/test/test.cpp | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/extra/yassl/taocrypt/test/test.cpp b/extra/yassl/taocrypt/test/test.cpp index 9e3ef709a78..d2eff49c56c 100644 --- a/extra/yassl/taocrypt/test/test.cpp +++ b/extra/yassl/taocrypt/test/test.cpp @@ -74,7 +74,8 @@ using TaoCrypt::EncodeDSA_Signature; using TaoCrypt::DecodeDSA_Signature; using TaoCrypt::PBKDF2_HMAC; using TaoCrypt::tcArrayDelete; - +using TaoCrypt::GetCert; +using TaoCrypt::GetPKCS_Cert; struct testVector { @@ -103,6 +104,7 @@ int rsa_test(); int dsa_test(); int dh_test(); int pwdbased_test(); +int pkcs12_test(); TaoCrypt::RandomNumberGenerator rng; @@ -228,6 +230,13 @@ void taocrypt_test(void* args) else printf( "PBKDF2 test passed!\n"); + /* not ready yet + if ( (ret = pkcs12_test()) ) + err_sys("PKCS12 test failed!\n", ret); + else + printf( "PKCS12 test passed!\n"); + */ + tcArrayDelete(cipher); tcArrayDelete(plain); tcArrayDelete(msg); @@ -994,3 +1003,38 @@ int pwdbased_test() return 0; } + + +int pkcs12_test() +{ + Source cert; + FileSource("../certs/server-cert.pem", cert); + if (cert.size() == 0) { + FileSource("../../certs/server-cert.pem", cert); // for testsuite + if (cert.size() == 0) { + FileSource("../../../certs/server-cert.pem", cert); // Debug dir + if (cert.size() == 0) + err_sys("where's your certs dir?", -109); + } + } + + if (GetCert(cert) != 0) + return -110; + + Source source; + FileSource("../certs/server.p12", source); + if (source.size() == 0) { + FileSource("../../certs/server.p12", source); // for testsuite + if (source.size() == 0) { + FileSource("../../../certs/server.p12", source); // Debug dir + if (source.size() == 0) + err_sys("where's your certs dir?", -111); + } + } + + if (GetPKCS_Cert("password", source) != 0) + return -112; + + return 0; +} + |