summaryrefslogtreecommitdiff
path: root/luni/src/test/java/tests/targets
Commit message (Collapse)AuthorAgeFilesLines
* Add TestRule to enable access to deprecated BC algorithmsPaul Duffin2019-09-251-18/+8
| | | | | | | | | | | | | | | | | | | | | | | Android restricts access to a number of deprecated BouncyCastle algorithms to APKs that target SDK version <= 27. However, those algorithms still need testing. Rather than set the target SDK version to be <= 27 (which could have other side effects) tests use Providers.setMaximumAllowableApiLevelForBcDeprecation(int) to raise the level to make them accessible at the current target SDK version and resets it the default value afterwards. This change adds a JUnit test rule to implement that behavior and uses it to replace duplicate setUp() and tearDown() code across a number of tests. It also insulates the tests from having to access the internal sun.security.jca.Providers and dalvik.system.VMRuntime classes. This is intended to be used by external/conscrypt so that the conscrypt-tests module can stop depending on core-all-systems-module. Bug: 141539296 Test: atest CtsLibcoreTestCases Change-Id: If41b5c221c392e9b6d14d500537115d3380c4999
* Cleanup some support test classesPaul Duffin2019-01-236-10/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preparation for splitting core-tests-support into two parts, one that depends only on core_current and can be used outside libcore and one that can depend on core-all directly. Deletes a lot of classes that are no longer used. Some of the classes were only used by external/conscrypt tests and it has its own copies of them. Some of them were copied over from harmony and are not used in libcore tests. Some of them have been extracted into external/mockwebserver. Moves some classes that are only used internally by a couple of luni tests to am appropriate luni/src/test/java directory to reduce the number of split packages. Tightens up visibility in a couple of classes. Removes some unused members from a couple of classes: * support/src/test/java/libcore/java/security/StandardNames.java * support/src/test/java/libcore/javax/net/ssl/SSLConfigurationAsserts.java Bug: 117547194 Test: make checkbuild && \ atest CtsKeystoreTestCases CtsNetTestCases conscrypt-tests \ FrameworksCoreTests KeyChainTests time_zone_distro-tests \ CtsLibcoreTestCases Change-Id: I8b258e66911ece69d4eaefef56810e17dddb2583
* Deprecate BC implementations of duplicated algorithmsAdam Vartanian2017-10-131-0/+19
| | | | | | | | | | | | | | | | | | | | | | | The first step in deprecating the BC implementations of algorithms that are also provided by Conscrypt. This checks whether the app's target API level is greater than a given threshold (currently O, but subject to change later) and disallows access to those algorithms when true. This limit only applies to requests from the system-created BC provider. Apps can install their own provider, in which case they get the implementations they requested. This doesn't yet implement the deprecation for Cipher instances, since the transformation scheme makes that more complicated. The ultimate removal of these algorithms, once a sufficient deprecation period has elapsed, is tracked in b/67761667. Bug: 67626877 Test: cts -m CtsLibcoreTestCases Test: cts -m CtsLibcoreOkHttpTestCases Test: cts -m CtsLibcoreWycheproofBCTestCases Test: cts -m CtsLibcoreWycheproofConscryptTestCases Change-Id: I48f07226e66873a65859121af32028c1547952ac
* CertificateTest: explicitly set validity check dateKenny Root2016-11-091-0/+10
| | | | | | | | | | | Since this test uses pre-generated certificates, they will expire eventually given enough time. Instead of regenerating them, just set the date in the PKIXParameters to compare their validity against. Test: vogar --mode host --classpath out/host/common/obj/JAVA_LIBRARIES/core-tests-support-hostx_intermediates/classes.jack --classpath out/host/common/obj/JAVA_LIBRARIES/core-tests-hostdex_intermediates/classes.jack libcore/luni/src/test/java/tests/targets/security/cert/CertificateTest.java Bug: 32756119 Bug: 32767302 Change-Id: Id48ecf289277ae9d98642b15aaa17c126bdc43e9
* Fix CertPathBuilderPKIX testKenny Root2016-02-041-42/+23
| | | | | | | | | | The previous test assumed that the TrustAnchor will be included in the CertPath which it is explicitly documented not to be. Instead we create a path of end entity, intermediate CA, then root CA and check that the entity we expected is selected. Bug: 26954159 Change-Id: Ie773c7165a700ec6d8dbc05d0b434e6ced781795
* Get rid of as much of dalvik.annotation.* as we can.Narayan Kamath2015-07-153-8/+0
| | | | | | | Some of it is public API (why oh why..) so we're forced to keep it around. Change-Id: Ic1e059d7162c442a1a996eb1510d0f7f84add34e
* Prefer PKIX algorithm name for TrustManagerFactory and KeyManagerFactoryBrian Carlstrom2012-10-292-4/+2
| | | | Change-Id: I3da5bdf6739c6aee5ec0174e93cd6c06d6dfeeb3
* Fix backwards Engine cache testBrian Carlstrom2011-10-182-1/+6
| | | | | | | | Also fix SignatureTestMD2withRSA to clean up its test provider. Add context information on failures to CertificateTest. Bug: 5479141 Change-Id: I9a5ce60cfda63cfc418e72464eb1d3ef81dab0c0
* post bouncycastle 1.46 upgrade test cleanupBrian Carlstrom2011-04-142-44/+37
| | | | Change-Id: I6e9be66b3f4fd4c09b31e2508236af62fa5214e3
* Removing use of @tests and @Test.* annotationsBrian Carlstrom2011-03-024-92/+0
| | | | Change-Id: I89243efdeebe22543c45a2166b634f40c3e78cf8
* Remove all the remaining AllTests cruft.Elliott Hughes2011-02-282-77/+0
| | | | Change-Id: Ie61022069e597d9c5c6e7ea4659fd614efe31852
* Test updates for Elliptic CurveBrian Carlstrom2010-11-188-182/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updated with Elliptic Curve (EC) (and SunPKCS11-NSS) names for use by ProviderTest support/src/test/java/libcore/java/security/StandardNames.java Enhance test_KeyStore_cacerts_bks to verify PublicKey can be retreived. Before this the test would pass even though an ECPublicKey could not be accessed. With EC support in external/bouncycastle, this test now passes. luni/src/test/java/libcore/java/security/KeyStoreTest.java New SignatureTest to cover ECDSA, replaces the old one that required a subclass per tested algorithm. luni/src/test/java/libcore/java/security/SignatureTest.java support/src/test/java/tests/security/SignatureTest.java luni/src/test/java/tests/targets/security/SignatureTestMD5withRSA.java luni/src/test/java/tests/targets/security/SignatureTestNONEwithDSA.java luni/src/test/java/tests/targets/security/SignatureTestSHA1withDSA.java luni/src/test/java/tests/targets/security/SignatureTestSHA1withRSA.java luni/src/test/java/tests/targets/security/SignatureTestSHA256withRSA.java luni/src/test/java/tests/targets/security/SignatureTestSHA384withRSA.java luni/src/test/java/tests/targets/security/SignatureTestSHA512withRSA.java luni/src/test/java/tests/targets/security/AllTests.java Improve ProviderTest logging while debugging SunPKCS11-NSS provider issues. Added some exceptions for RI missing classes. luni/src/test/java/libcore/java/security/ProviderTest.java Changed style slightly to match KeyPairGeneratorTest, where +N is used to indicated when multiples of a increments of a certain amount are required for valid key sizes. luni/src/test/java/libcore/javax/crypto/KeyGeneratorTest.java Fix test CloseGuard issues luni/src/test/java/libcore/java/security/KeyStoreTest.java Fix readability luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java Bug: 3058375 Change-Id: I99cd93ad66372e8512d993168550cc1d471d3248
* Fixes to support new dalvik.googlecode.com benchmarksBrian Carlstrom2010-06-293-64/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following new benchmarks where tested with the below changes: - DigestBenchmark - MessageDigestBenchmark - SSLSocketBenchmark - SignatureBenchmark Fix package name of OpenSSLProvider luni/src/main/java/java/security/security.properties Restore Java (vs OpenSSL) SSLSocket wrappers on SSLEngine for benchmarking luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketFactoryImpl.java luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImpl.java luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketFactoryImpl.java luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketInputStream.java luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketOutputStream.java luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketWrapper.java Restore HandshakeProtocol.socketOwner code for SSLSocket to function luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java Remove unneeded OpenSSLMessageDigestJDK.getInstance since these are registered via OpenSSLProvider and SHA224 which is not part of the RI. We had already removed the BouncyCastle version of this. luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLMessageDigestJDK.java luni/src/test/java/tests/targets/security/AllTests.java luni/src/test/java/tests/targets/security/MessageDigestTestSHA224.java luni/src/test/java/tests/targets/security/SignatureTestSHA224withRSA.java Change-Id: I7daae7f0d9f50acad6df9157eac1b0133af83062
* Scrubbing tests marked @BrokenTest.Jesse Wilson2010-06-2452-2608/+32
| | | | | | | | | | | | | | | This rearranges the security test support infrastructure. We no longer rely on many top-level classes defined in CipherHelper.java to provide test support. Instead these each have their own top level class in our test support package: support/src/test/java/tests/security. Similarly for abstract classes intended to be subclassed by cipher-specific tests. Other test methods that were duplicated in Harmony have been removed. We need to pay closer attention to Harmony failures because they are now our only source of coverage for some of these tests. Change-Id: I1a1ca8a046bc9b6a33d5fa3f55fecc0d39f72c16
* Remove targets.*Brian Carlstrom2010-06-1836-43/+1
| | | | Change-Id: I9b795477fb1f64f613c2d7cc48476284702fd429
* Remove all trailing whitespace from the dalvik team-maintained parts of libcore.Elliott Hughes2010-05-1318-92/+92
| | | | | | Gentlemen, you may now set your editors to "strip trailing whitespace"... Change-Id: I85b2f6c80e5fbef1af6cab11789790b078c11b1b
* merge more modules into luniPeter Hallam2010-04-2753-0/+5211