summaryrefslogtreecommitdiffstats
path: root/luni/src/test/java
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | libcore: remove unnecessary assertion in testNewConstructors_SuccessSergio Giro2015-06-221-1/+0
|/ / / / / | | | | | | | | | | | | | | | | | | | | Change-Id: Ib97a6d9a01d30ea708e79fe10d273e1bb752dff9 (cherry picked from commit 14ba1a7bfb28a300ba9679cd9f402ee3cd48c249)
* | | | | Make sure the Services cache is refreshedKenny Root2015-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the class initialization, a special path is taken when all the built-in providers are initialized. This means that the "needsRefresh" flag is not set initially and the cache is not refreshed when the SecureRandom service is checked. Bug: 21970647 Change-Id: Idb796ec5e3ac04424e5fd3a90607666ae23817d5 (cherry picked from commit 10dced1155cb3689ca63383a3b0b794bc3735268)
* | | | | ProviderTest : make sure alias / algo. lookups are case insensitive.Narayan Kamath2015-06-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | bug: 21870226 Change-Id: I6c45ef97a9f24f74f0b3ad0098ccb9ef14ddd349
* | | | | ProviderTest: Add provider name to failure message.Narayan Kamath2015-06-181-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug: 21870226 Change-Id: I1d91661599276394343b36a6601026ad46fc6b30
* | | | | libcore: removed unnecessary code in SSLSocketTestSergio Giro2015-06-171-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Was possibly causing a race condition (see b/21776011), for instance, in case readFirstReceivedChunkFuture was still executing IoUtils#closeQuietly while the thread was cancelled. Bug: 21776011 (cherry picked from commit c22dd77f727262ed8105b8b638aeb817997914fd) Change-Id: Ibb20a98102d5bdc9ac3eaa0b875801ab218356f1
* | | | | Merge "Do not blacklist serial numbers that are too short" into mnc-devKenny Root2015-06-151-15/+0
|\ \ \ \ \
| * | | | | Do not blacklist serial numbers that are too shortKenny Root2015-06-151-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Baseline Requirements say the serial number must have 20-bits of entropy, but some certificates are issued not in compliance. This causes issues where they are falsely marked as blacklisted. Until there is issuer + serial number matching, we can just use the pubkey matching for the certificates that are blacklisted with non-compliant serial numbers. Bug: 21736046 Bug: 21816853 Change-Id: I44e6d490099fbe1da2f5afb5ef61196a4593e04f
* | | | | | Merge "Fix X509CertificateTest#test_Provider." into mnc-devAlex Klyubin2015-06-151-0/+7
|\ \ \ \ \ \
| * | | | | | Fix X509CertificateTest#test_Provider.Alex Klyubin2015-06-151-0/+7
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test got broken by AndroidKeyStore Provider exposing a Signature implementation which does not accept vanilla public keys -- it only accepts AndroidKeyStore Provider's public keys. The fix is to skip AndroidKeyStore Provider in this test. Bug: 21814211 Change-Id: If6a2241d6e3292ab9de94d14a24fd958eeb1cbf5
* | | | | | Fix CertificateTest#testVerifyPublicKeyString2Narayan Kamath2015-06-151-8/+7
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a provider that can handle the provided public-key. bug: 21816913 Change-Id: Iee7a932a8767c4c1b781636dfb9456a1b604532f
* | | | | libcore: add tests to check behaviour for padding and decrypt modeSergio Giro2015-06-111-9/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 19186852 Change-Id: I8c51b309ca98030ab1eda5b2a0201a97a5758072 (cherry-pick from 9f7960cfda26dab222d522c28ca44902d996f3e4)
* | | | | Merge "SSLSocketTest: add test with no ciphers" into mnc-devKenny Root2015-06-101-0/+31
|\ \ \ \ \
| * | | | | SSLSocketTest: add test with no ciphersKenny Root2015-06-101-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there are no ciphers set, there should just be a handshake failure. However, Conscrypt was throwing InvalidArgumentException in this configuration. (cherry picked from commit def50a267d0100fa560cf7bbcd0b9a9d5f5e068f) Bug: 21195269 Change-Id: I73cfc4927041ca9b1331b58859382573e7de6f63
* | | | | | Merge "Explicitly set DateFormat.is24Hour value needed by tests" into mnc-devNeil Fuller2015-06-101-0/+6
|\ \ \ \ \ \
| * | | | | | Explicitly set DateFormat.is24Hour value needed by testsNeil Fuller2015-06-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests fail under CTS if the device is set to use the 24 hour clock. The tests that depend on the value of the setting are now being explicit. Bug: 20899571 Bug: 20937589 Bug: 20939139 Bug: 20378566 Bug: 21585934 Bug: https://code.google.com/p/android/issues/detail?id=162384 Change-Id: I0f03f54b76dc5d343a2c842434412ff59908b129
* | | | | | | Relax the test for inappropriate fallbackKenny Root2015-06-091-4/+7
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we don't have a specific exception type for the SCSV inappropriate fallback cipher being used, we relied on scanning the cause message. BoringSSL has the error message of "INAPPROPRIATE_FALLBACK" which doesn't match the OpenSSL error message of "inappropriate fallback" so we need to relax the test a bit to accept both. This should be fine as we're just using the message as a proxy to determine whether the correct thing is done and not really trying to enforce a specific exception message. (cherry picked from commit 43e063b43daab0962554639dda272428a59f3c24) Bug: 21211765 Change-Id: I4e7cd5486c0eb8ab3e3f9b64b4e7234436ec4ee0
* | | | | | Skip AndroidKeyStore provider in ECDHKeyAgreementTest.Alex Klyubin2015-06-091-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AndroidKeyStore Provider requires special keys which cannot be created through standard JCA API. The Provider does not expose ECDH at the moment either. If/when it does expose ECDH, it will be tested in cts/tests/tests/keystore rather than here. Bug: 21723152 Change-Id: I73128907783b4f08c60c9af128e12a124a286054
* | | | | | libcore: throw InvalidKeyException instead of ProviderExceptionSergio Giro2015-06-095-1/+230
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In java.security javax.crypto and java.security classes with late binding, when guessing the provider and none of the available ones supports the specified key Bug: 18987633 (cherry pick from e38b83dd96281d178b01476b67d354655bf2de62) Change-Id: I5931046e9044984baf724157138bf3a7c7ef5e90
* | | | | Ignore AndroidKeyStore in SignatureTest.Alex Klyubin2015-06-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AndroidKeyStore* provider's Signature implementation requires special keys which cannot be created through standard JCA API. This Signature implementation is tested separately in cts/test/test/keystore. Bug: 18088752 Bug: 20912868 Change-Id: I1f134cbae0c0136a4dec937103d6fde79192948d
* | | | | No need to test EC keys of 192 bitsKenny Root2015-06-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EC keys of 192 bits have a security level of 96 bits which is well below accepted minimum levels according to NIST SP800 131A. No need to be able to generate these anymore. Instead test 521-bit EC keys. (cherry picked from commit 9b8f9a1bb00f70f79f175282969d428d2aade062) Bug: 20563457 Change-Id: I674c255c55c910bb8f9ccdf1e5ad7f69a2bdac69
* | | | | Signature2Test: calling verify a second time can throwKenny Root2015-05-291-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The docs for Signature don't guarantee that the implementation will not throw. It is perfectly fine to throw here. The original bug for which this check was added is bogus (re: https://code.google.com/p/android/issues/detail?id=34933) in that the RI behavior is clearly not the same as this test indicates with the StandardNames.IS_RI branch. (cherry picked from commit fb8371585860dd8f2321f47c490c1a622f5158ce) Bug: 18869265 Change-Id: I6e413cac85daf5b14bc20adc2279741ab11d97f6
* | | | | Merge "Add test for application use of PathClassLoader." into mnc-devRichard Uhler2015-05-281-0/+23
|\ \ \ \ \
| * | | | | Add test for application use of PathClassLoader.Richard Uhler2015-05-281-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 19937016 (cherry picked from commit 58bef8e53e41a4b7cfe9cf647dca7c6d46528f32) Change-Id: I347b4eee1f1e3702d34ea10feca6bc1b3f2f1ee8
* | | | | | Don't throw UnsupportedOpEx on multi-char negative/percent symbols.Narayan Kamath2015-05-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There seem to be a fair number of apps that call through to this function, so just give them a "bogus" value (from Locale.ROOT) when we encounter a multi-char symbol. The formatters and other java.text APIs already use the correct multi-char value. bug: 18785260 (cherry picked from commit c3cedb412d85ffeb8121b69308b2d2c35c63b287) Change-Id: I71225102d4f501aaa689fa6e5f84ee967e32f0c8
* | | | | | Change >= to > in OldSystemTest.test_gcMathieu Chartier2015-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test no longer will pass if no GC happens. (cherry picked from commit ea43704065f3472072355a2e199ef99ebaecd681) Bug: 21211315 Change-Id: I9fd0a4b5e249ab7b47d6f8e339a4f6a059af7426
* | | | | | Fix OldSystemTest gcMathieu Chartier2015-05-271-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls System.gc + System.runFinalization since System.gc is usually a NOP. Bug: 21211315 (cherry picked from commit f49f9d8762770b0c9e2493b4656c70ecb6803df4) Change-Id: Ib816521c6ed43eca437bf8fa961650f7fb96ba61
* | | | | | Merge "Fix problems with DexClassLoaderTest." into mnc-devRichard Uhler2015-05-271-289/+154
|\ \ \ \ \ \
| * | | | | | Fix problems with DexClassLoaderTest.Richard Uhler2015-05-261-289/+154
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a problem with the DexClassLoaderTest where oat files from previous tests were being cached and reused for later tests. Now each test uses its own directory for loading-test.dex and friends so they are treated as separate dex files from test to test. As part of this fix, the helper functions for the tests were reorganized. Bug: 21033982 Change-Id: I66d011109259c0c3688b64b083d4ef1ed70feae2
* | | | | | Serialize minusSign/percentSign as strings in DecimalFormatSymbols.Narayan Kamath2015-05-271-0/+20
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to Parcel DFS objects (not sure why anybody would do that, but..) without crashes. bug: https://code.google.com/p/android/issues/detail?id=170718 bug: 21455225 (cherry picked from commit 4fd2c14ce54447f13cd115e105d7b000adf24c2e) Change-Id: I8f860b3fc764932291000ac6651bc95a8e457a99
* | | | | Follow-up for incorrect test pre-conditionKenny Root2015-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The provider should *not* be present before we install this provider, so update the test to actually assert the correct state. (cherry picked from commit b9129dc7847dd1a89fb5f8d3108369b4da3b0e21) Bug: 21159204 Change-Id: I30f4d4f47fcb6bf278b81c5fd5900d47233cefdb
* | | | | Fix test18566 to have the correct expectationKenny Root2015-05-191-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before the test was allowing invalid encoding in PKCS#1 data, but this is an exploitable condition in certain cases. See for instance https://www.imperialviolet.org/2014/09/26/pkcs1.html Since BoringSSL has the change to disallow this problem, we are switching this to assert that the signature did not verify. (cherry picked from commit 559126c953cf0e1e4986e24c019bbf996d5ab795) Bug: 21209498 Bug: 5038554 Bug: http://code.google.com/p/android/issues/detail?id=18566 Change-Id: Ie040f644a4588c6801e5557e2f9a3bcdedfd30ac
* | | | | Get rid of old Harmony Services cacheKenny Root2015-05-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each java.security.Provider.Service has its own cache, so there is not a lot of benefit to having another cache of the caches. In fact, this makes adding a new provider a huge hit. This change makes adding a new empty provider go from ~5080 microseconds to 73 microseconds. (cherry picked from commit cc4791ad77128039c93d4c03b582d4dc397e6a02) Bug: 21159204 Change-Id: Ib23032f8cb0def79367a321b48241b6cc94de6b0
* | | | | Add an additional check for ICU4J tz data versionNeil Fuller2015-05-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confirm that ZoneInfoDB, ICU4C and now ICU4J all agree on the tz data version. (cherry-pick from commit 32e7bc11723014cc63706541286d0fdf9fbba510) Bug: 19941636 Change-Id: I841de7256f9409abe4b8bcdd66595c346de7c534
* | | | | Fix a couple of issues in DexClassLoaderTest.Narayan Kamath2015-05-141-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't create an empty file if test resources are unavailable, fail instead. - Only enumerate ".dex" files in the optimized directory - leave out things like ".flock" files etc. Partial fix for... bug: 21033982 Change-Id: Icf00d4d35f23a1927ea034fdf0ab8ea01f16fe0c
* | | | | Add tests for AES/GCM/NOPADDINGKenny Root2015-05-131-42/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit d5ed0e9c84915f2a93e25a4d152f837a661c4774) Bug: 21085702 Change-Id: I1a88f6410bb61a885bbb447a6e7b86b011dc8625
* | | | | libcore: add test for arbitrary ECC groups.Adam Langley2015-05-131-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test verifies an ECDSA signature on the BitCoin curve. (cherry picked from commit daadb9f7d41188c0cf2eaaf58d43b7fd46c08da9) Bug: 21085331 Change-Id: I404979ce9b80959a1f88dc340b77507eb53b8cfe
* | | | | Fix for TimSort in the two Java forms in libcoreNeil Fuller2015-05-131-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 19493779 (cherry-picked from commit f547d3aa155a20cfc7cb9852f595ce0806bd1198) Change-Id: I71c7c143386aa4d805b6f1418b72573ddec05dec
* | | | | Fix a couple of Locale bugs discovered by ICU4J tests.Narayan Kamath2015-05-121-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ULocaleTest revealed two issues : - We weren't handling the legacy ja_JP_JP and th_TH_TH locales correctly. - We weren't lower-casing the extension key in forLanguageTag. This shouldn't matter since language tags are case insensitive, by definition but the convention is to keep them lowercase. This also fixes a bug in the builder where extension keys were case sensitive since we weren't normalizing them properly. bug: 20252611 (cherry picked from commit e45a8ec4f4c53bd068e2eec6d3d07e7567e8381a) Change-Id: Ide19c959c53e44f07e6b781a130c220b52e18352
* | | | | Fix bug in formatting intervals at month boundaries.Travis Keep2015-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In formatting date intervals, we subtract one day from the end time if it falls on midnight the next day so that both times are in the same day, thereby avoiding the date appearing in the formatted interval. We did this by calling endCalendar.roll(Calendar.DAY_OF_MONTH, false). However, if endCalendar was 1 May 2015 (say), the date rolls over to 31 May 2015 (this is the documented behaviour of roll). We now use endCalendar.add(Calendar.DAY_OF_MONTH, -1) which always subtracts a day so that 1 May 2015 becomes 30 April 2015, this is the desired behavior. bug: 20708022 (cherry picked from commit 13faecd3105c23f8a60ce3a5847056489fd2d037) Change-Id: Ic947c7c65008d23d1cb1b9bde6af35972ac6acd7
* | | | | Add a test for bug 20708022.Narayan Kamath2015-05-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check that we correctly format date ranges that end at 00:00 on the first day of a month. bug: 20708022. (cherry picked from commit 61dd198b79cd5c63fd8f18f7096b0f44b1491cd5) Change-Id: Ia6387ac560024115314fd3fee2669c6cc11020a7
* | | | | am 1bc6f080: Merge "Adjust MacTest for Bouncy Castle workaround." into mnc-devAlex Klyubin2015-04-301-4/+9
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * commit '1bc6f080c77deb3cc53d55ec60c98167ea093911': Adjust MacTest for Bouncy Castle workaround.
| * \ \ \ \ Merge "Adjust MacTest for Bouncy Castle workaround." into mnc-devAlex Klyubin2015-04-301-4/+9
| |\ \ \ \ \
| | * | | | | Adjust MacTest for Bouncy Castle workaround.Alex Klyubin2015-04-291-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AndroidKeyStore-backed Mac implementation is now offered by the "AndroidKeyStoreBCWorkaround" provider (see 4812563f68c87278af68309662433279d10f573e). The test was changed accordingly. Moreover, this test was using a wrong way of detecting the default provider for HMACs that can handle SecretKeySpec instances. This is now fixed as well. Bug: 20691708 Change-Id: I0b3a2d1ff6d968779419305978203ad64d703e99
* | | | | | | am 3bb83381: Add a ZoneInfoDB.hasTimeZone API.Narayan Kamath2015-04-301-0/+7
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | * commit '3bb833819dba8d530620ad6d43dc53c3fd54763b': Add a ZoneInfoDB.hasTimeZone API.
| * | | | | | Add a ZoneInfoDB.hasTimeZone API.Narayan Kamath2015-04-301-0/+7
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows us to query the DB without having to clone an object or an entire strings array. bug: 19106773 bug: 19987403 Change-Id: I66d466e414972b02a75bcfe68263e74de8b9a768
* | | | | | am 12f81a0a: Merge "CipherTest: make multiple doFinal calls for RSA/ECB"Kenny Root2015-04-281-0/+11
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '12f81a0a9bea7997cddc799ea9cc26a55505e34e': CipherTest: make multiple doFinal calls for RSA/ECB
| * \ \ \ \ \ Merge "CipherTest: make multiple doFinal calls for RSA/ECB"Kenny Root2015-04-281-0/+11
| |\ \ \ \ \ \
| | * | | | | | CipherTest: make multiple doFinal calls for RSA/ECBKenny Root2015-04-281-0/+11
| | | |/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OpenSSLCipherRSA wasn't updating its buffer offset. The regular test_getInstance loop tests this, but since RSA/ECB is 'special' we have this extra test. Change-Id: I27819dad1b0bf59ddd1782b722757fe7526db2df
* | | | | | | am 930025e2: Merge "Date.toString must always use Locale.US."Narayan Kamath2015-04-281-5/+6
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | * commit '930025e26a243235f02b30f97c5c5e378e1334e1': Date.toString must always use Locale.US.
| * | | | | | Date.toString must always use Locale.US.Narayan Kamath2015-04-281-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug: https://code.google.com/p/android/issues/detail?id=81924 Change-Id: Id5e0ec6514f159d548617e5d9946088078b89afa