| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
Adds coverage for the following:
java.security.cert.CertPathBuilderSpi.engineGetRevocationChecker()
java.security.cert.CertPathValidatorSpi.engineGetRevocationChecker()
java.security.cert.PKIXCertPathChecker.check(java.security.cert.Certificate)
java.security.cert.PKIXRevocationChecker.clone()
Bug: 182166056
Test: atest CtsLibcoreTestCases
Change-Id: Id2e5c1f4efcfa6560c04a2f129a8171afc146069
|
| |
|
|
|
|
|
|
| |
The test no longer fails, probably because the implementation
changed when migrated to ojluni/.
Test: atest CtsLibcoreTestCases:tests.java.security.SecureClassLoaderTest
Change-Id: I212d93d34c8832ec64e8104840b9b60d39dee6da
|
| |
|
|
|
|
| |
Bug: 182166453
Test: atest CtsLibcoreTestCases:libcore.java.security
Change-Id: Ic528c887c6ef85dcd3b814b38a8cf756a924675a
|
| |
|
|
|
|
|
|
|
|
|
| |
The 3 methods are as shown in http://b/119393918#comment22:
org.w3c.dom.ls.LSException.LSException(short, java.lang.String)
libcore.util.HexEncoding.encode(byte[], int, int)
libcore.util.NativeAllocationRegistry.applyFreeFunction(long, long)
Bug: 119393918
Test: Ran the relevant tests in CtsLibcoreTestCases
Change-Id: I31acf1c0b11f4f9e4eabc56ba73d637e2401c4f2
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CERT_CORRECT in X509Certificate2Test is not correct at all. It contains
a slew of encoding mistakes:
- BOOLEAN { FALSE } is not a valid parameter for dsa-with-sha1. Per
RFC3279, the parameters should be omitted.
- dsa-with-sha1 is not a valid SPKI OID. It's a signature OID. The DSA
SPKI OID is different and needs DSA parameters.
- The body of the SPKI is not a DSA public key.
- A GeneralName using the directoryName CHOICE arm should use explicit
tagging, not implicit tagging. This is a weird corner case of ASN.1
that a lot of folks get wrong.
- 0x01 is not a valid BOOLEAN in DER. The correct encoding of TRUE is
0xff.
- An authorityKeyIdentifier is a moderately complex structure, not a
BOOLEAN.
- A subjectKeyIdentifier is an OCTET STRING, not a BOOLEAN.
- A policyMappings is a moderately complex structure, not a BOOLEAN.
The test is checking that the basicConstraints extension is correctly
parsed, but that isn't a great test when the certificate is invalid.
X.509 is an extensible format, so which syntax errors are rejected
when is a complicated question. (E.g.,
https://github.com/google/conscrypt/issues/916). It happened that
Conscrypt did not reject the certificate today, but it also would have
been valid for Conscrypt to reject it. A recent issue in Conscrypt
coincidentally tripped this test bug. The Conscrypt fix will have a
unit test closer to the code, so we can fix this test cert.
This CL fixes the test certificate to test what it's actually aiming
to test. I've manually reworked the mistakes using
https://github.com/google/der-ascii and replaced the DSA OIDs with
ECDSA so that a correct key is a bit more compact. (The test only parses
basicConstraints, so it does not care.) The signature itself is still
not valid, but the test does not check signatures, so this is fine.
I've also applied the same fixes to CERT_TAMPERED, which appears to be a
slightly tweaked version of CERT_CORRECT. (Although CERT_TAMPERED
appears to have some intentional syntax errors that break the parse.)
Test: Treehugger
Bug: 171808928
Change-Id: Ide6b2e46f4eb172d33b266759a76ea063f5c989e
|
| |
|
|
|
|
|
|
| |
Using JUnit4 which may allow a longer timeout instead deprecated JUnit3
Bug: 168307913
Test: atest --iterations 100 CtsLibcoreTestCases:tests.java.sql.StressTest#testInsertOfManyRowsUsingManyThreads
Change-Id: I3e6c3cf362815830f6955738e9443c6b497012cc
|
| |
|
|
|
|
|
|
| |
See https://source.android.com/setup/contribute/respectful-code for reference
Bug: 161896447
Test: atest CtsLibcoreTestCases:tests.com.android.org.bouncycastle.jce.provider.CertBlocklistTest
Change-Id: I27e7b592b0edfa4c336254585324b5eafdff093f
|
| |
|
|
|
|
|
|
| |
See https://source.android.com/setup/contribute/respectful-code for reference
Bug: 161896447
Test: m
Change-Id: Ia9bec4b31a2071323e1682782bdbf731702c53b9
|
| |
|
|
|
|
|
|
|
| |
See https://source.android.com/setup/contribute/respectful-code for
reference
Bug: 162205877
Test: m java
Change-Id: I44880f3de79d9e36597d8384f074c512d2d855d4
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this change,
tests.security.cert.CertPathBuilder1Test#testBuild was annotated as a
@KnownFailure, but was not listed in knownfailures.txt. This was an
anomaly, and is misleading since the AndroidTest.xml for
CtsLibcoreTestCases is currently configured so that knownfailures.txt
is obeyed but @KnownFailure is not, so this test is actually *not*
skipped. The test also passes, happily.
The plan for adding libcore TEST_MAPPINGs requires changing that
AndroidTest.xml to respect @KnownFailure. Fixing this anomaly will
make that change a no-op, which is desirable.
Test: cts-tradefed run cts-dev -m CtsLibcoreTestCase -t tests.security.cert.CertPathBuilder1Test
Bug: 130283485
Change-Id: I030331192874cd58abafcbceac5be2e4430ad548
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
This change relates to one in build/soong that adds
bouncycastle, conscrypt and okhttp.
Bug: 113148576
Test: treehugger
Change-Id: I3bf02b065c92ccc86df77234625481130894c08d
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |\
| |
| |
| |
| |
| |
| |
| | |
am: 37d40e6a2f am: 696fd7eda4
am: b4b3b98907
Change-Id: I94ff9842571fbda569b410e97d420edd7a332fa0
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This applies the same regexp replacement across libcore that
http://r.android.com/345826 had only applied to ojluni.
Most of the previous noncanonical spellings were a lowercased
"android-" that should be "Android-".
This CL was created by running the following command on top of
the above CL. No manual changes were made.
find . -name \*\.java | xargs sed -i \
-e 's/Android[- ]changed/Android-changed/ig' \
-e 's/Android-changed :/Android-changed:/g' \
-e 's/Android-changed \(BEGIN\|END\)/\1 Android-changed/g' \
-e 's/Android-changed - /Android-changed: /g' \
-e 's/Android[- ]removed/Android-removed/ig' \
-e 's/Android-removed :/Android-removed:/g' \
-e 's/Android-removed \(BEGIN\|END\)/\1 Android-removed/g' \
-e 's/Android-removed - /Android-removed: /g' \
-e 's/Android[- ]added/Android-added/ig' \
-e 's/Android-added :/Android-added:/g' \
-e 's/Android-added \(BEGIN\|END\)/\1 Android-added/g' \
-e 's/Android-added - /Android-added: /g' \
-e 's/----- \(BEGIN\|END\) android\( -----\)\?/\1 Android-changed/g' \
-e 's/\/\* \(BEGIN\|END\) Android-changed \*\//\/\/ \1 Android-changed/g'
Bug: 35841464
Test: make droid cts
Change-Id: I060c7236b7607763e5d27d60aa395d2507703a95
|
| |\|
| |
| |
| |
| |
| |
| |
| | |
ef44626d0e am: a0aa6019dc
am: 2bb5cf4e08
Change-Id: I0a06ed38f90a3afb5cbdc48b55d6113c923d3d28
|
| | |
| |
| |
| |
| |
| |
| |
| | |
+ Minor fix in other tests javadoc
Test: vogar CertificateTest.java
Bug: 34923742
Change-Id: I63c84a310a52d60dd7ec9c1d9659929fff302934
|
| |\|
| |
| |
| |
| |
| |
| |
| | |
am: 215873d272 am: 15769dec6f
am: 3f8437ee75
Change-Id: If676058543be80da5f07425a1d4e998e1cceeb17
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |/
|
|
|
|
|
|
|
| |
There was a comparison of a byte against the value 200, which would
always fail. From the code below it's evident that the comparison should
be against the value 200 casted as a byte.
Test: vogar CertificateTest
Change-Id: I5dcde48bb9b64c55f66b9c6ef38050f734674318
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were no changes to code under test.
4 tests were fixed to not tolerate an Exception:
- libcore.java.util.CollectionsTest#test_CheckedMap_computeIfAbsent
In the case where a Map key is present, computeIfAbsent() should
not invoke the Function, so there is no return value that could
be expected to undergo a type check. The test was changed to
verify that the Function is not invoked.
- libcore.java.util.concurrent.CopyOnWriteArrayListTest#test_sort and
libcore.java.util.concurrent.CopyOnWriteArrayListTest#test_subList_sort
were sorting an already-sorted non-null list that contains no null
values. That logic was redundant and wouldn't have thrown.
- org.apache.harmony.security.tests.java.security.KeyStoreSpiTest#test_engineEntryInstanceOf
(the KeyStoreSpi documentation does not mention whether NPE is thrown;
the implementation comes from upstream and does not throw it).
54 tests were fixed by adding the missing
fail();
No attempt was made to make this failure message specific to the
exception that was expected.
Tests that weren't changed:
- SSLEngineTest.test_wrap_ByteBuffer_ByteBuffer_04() requires
investigation to determine the correct resolution.
A comment was added to the test linking to the corresponding bug.
- ThreadTest#testParkUntilWithUnderflowValue() and
OldNodeChangeEventTest.waitForEvent() were not touched since
it was not clear whether that it was relevent to the test whether
or not the exception was thrown.
- two cases in Files2Test#test_setPosixFilePermissions_NPE() are
left to a future CL
Test:
(croot; make vogar core-tests) \
&& git diff aosp/master --name-only | xargs vogar `cparg core-tests`
Change-Id: I1cd3220a06e331ff049b146b393f78879f07211a
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pulling upstream changes from OpenJDK version jdk8u60 classes
in java.security.cert
- Certificate#hashValue: cache the hash value as to avoid recomputation.
Use the Arrays#hash instead of a simple ad-hoc function.
- Certificate#verify(PublicKey, Provider): new method that just throws
UnsupportedOperationException.
This commit also contains cosmetic JavaDoc changes like
- Use of @code in place of <code> tags and use of a package-info.java in
place of a package.html file.
- Added comments.
Note not all classes in java.security.cert are updated: X509CRL has more
significant changes and deserves a separate CL.
Change-Id: I44120f1b34c9dc3c062a5d01583bcc87fa2cd558
Test: make droid docs, vogar CertificateTest
Bug: 29631070
|
| |
|
|
|
|
|
| |
java file does not need x attribute. This patch removes it.
Change-Id: I2a7170d99f4bee7a7b819621c84dd197ded37fa2
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
|
| |
|
|
|
|
|
| |
Use == for object identity, Arrays.equals() for value equality.
Bug: 28189207
Change-Id: I3dcae7f5714e5ab7216b255de376a9c3030f94b8
|
| |
|
|
|
|
|
|
|
| |
This has a lasting side-effect on the rest of the tests run which
shouldn't happen. This is of dubious use, so just remove the setting of
these properties since there is no way to undo it later.
Bug: 28293120
Change-Id: I6788c5308e2ca7fb36283b81d7839a840e880584
|
| |
|
|
|
|
|
|
| |
Test to make sure CertificateRevokedException behaves correctly for
getAuthorityName().
Bug: 27812109
Change-Id: I3d9724e636b895b9359a0fd37e8bc0cc89dcc756
|
| |
|
|
|
|
|
|
| |
There is a new constructor that takes a BasicReason as an argument. Test
that it works correctly.
Bug: 27812109
Change-Id: I957678a774ab91c9fc2854f45f776c23c321960f
|
| |
|
|
|
|
|
| |
This doesn't actually test anything meaningful, so simply remove it.
Bug: 27812109
Change-Id: I07493cdb7423c789f1ddf23ef8eecb96ce091bec
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed
X509CertSelector#test_addSubjectAlternativeNameLintLjava_lang_String. This
CL disables the above test for GeneralNameInterface.Name_RFC822 as the
test was disabled in the earlier Android
releases.
The test was disabled in M
https://android.googlesource.com/platform/libcore/+/bd7a7c87692d3b5be341fbc5022eaa07611ae751/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java
and was reintroduced recently after the test was enabled after some
time it wasn't run:
https://android.googlesource.com/platform/libcore/+/5ef40918006efad4c7194b505c3ad176928711a3/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java
Disabling as it's failing and wasn't being run in M anyway.
Bug: 27706589
(cherry-picked from commit 443c076d6c1e6dafdc17af03ac8205e57a10aa23)
Change-Id: I8b0cc0d8ee2bc6d5f67cd7cce9274b0018c81da1
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix broken methods -
test_addSubjectAlternativeNameLintLjava_lang_String2,
test_addSubjectAlternativeNameLintLbyte_array2,
test_setSubjectKeyIdentifierLB$.getExtensionValue,
test_setSubjectAlternativeNamesLjava_util_Collection,
test_setPathToNamesLjava_util_Collection,
test_getSubjectAlternativeNames, test_getPathToNames,
test_addPathToNameLintLbyte_array,
test_addSubjectAlternativeNameLintLjava_lang_String,
test_addSubjectAlternativeNameLintLbyte_array. The methods were using
org.apache.harmony.security.asn1.* classes which no more exist and
instead, now use sun.security.x509.* classes.
Support for OID - 2.5.29.30, 2.5.29.37, 2.5.29.19 are removed from
test_setSubjectKeyIdentifierLB$.getExtensionValue as they
were not being used.
Bug: 26352408
Change-Id: I5d54a5b9307ff914471b0856bdc1217dd3af0511
|
| |
|
|
|
|
|
|
| |
tests.security.cert.X509CRLSelector2Test
libcore.java.security.cert.X509CertificateTest
Bug: 26352408
Change-Id: Ib83a48a174f80b448ea67e0423cb8069dfc77aa9
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
There is no default system scope anymore.
Bug: 26590281
Bug: 26517816
Change-Id: Icd3dd88bdf9c4525888a27652916a7323415453b
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
OpenJDK adjustments for master.
- Restored removed libcore.icu.* classes (needed
by the openjdk java.text.* classes). This will be
undone in short future.
- Adjusted java.lang.* and java.lang.reflect.* classes
for native reflection and other changes in master.
Bug: 25758743
Change-Id: Ifbbe5b1e8661138fc32ad24127f76f711dd585b7
|
| | |\
| | |
| | |
| | | |
Change-Id: I8f49c58f39dc5f4268c6b5718cab18ed26ac930a
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
According to rfc3280, when using URI as a NameConstraint it's
GeneralName should not contain schema. Details in section
4.2.1.11 of https://www.ietf.org/rfc/rfc3280.txt
Change-Id: Ibddbb4aa9db83139dc75be713a35f36ef68343d6
|
| | | |
| | |
| | |
| | | |
Change-Id: Ife0067f172c64868229bb06291f2a116a988b252
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
According to rfc3280, when using URI as a NameConstraint it's GeneralName should not
contain schema. Details in section 4.2.1.11 of
https://www.ietf.org/rfc/rfc3280.txt
Change-Id: I69bed45508c4091a7a13e70832fe63c77df538a8
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
RI doesn't throw exception for following OIDs: "0.20", "1.25", "2.39".
According to documentation here:
http://docs.oracle.com/javase/7/docs/api/java/security/cert/X509CertSelector.html#setSubjectPublicKeyAlgID(java.lang.String)
OID is invalid if first component is different than 0, 1 or 2 or
second component is bigger than 39.
Change-Id: Ib57142c86e6ac131b0e713a11e276715eae10911
|
| | | |
| | |
| | |
| | | |
Change-Id: Id14719899f5dcbd1da1f5067b6d54db9cb506f64
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
While generating key pairs, BouncyCastle checks that random numbers
are strong enough. Tests were using a mock random generator that
generates the constant 10.
Bug: 19657861
(cherry picked from commit 098bc41d846f847a6551209d65dbb74bfea3bb00)
Change-Id: Ifd1401f9b386e4039b8f51af65e5e7dc5fad15e2
|
| | |/
| |
| |
| |
| |
| |
| | |
Use a provider that can handle the provided public-key.
bug: 21816913
Change-Id: Iee7a932a8767c4c1b781636dfb9456a1b604532f
|
| | |
| |
| |
| |
| | |
Bug: 25185203
Change-Id: I46049de88c5f6923ac7d148b9dfa6f9112c00930
|
| | |
| |
| |
| |
| |
| |
| | |
Some of it is public API (why oh why..) so we're forced to
keep it around.
Change-Id: Ic1e059d7162c442a1a996eb1510d0f7f84add34e
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
While generating key pairs, BouncyCastle checks that random numbers
are strong enough. Tests were using a mock random generator that
generates the constant 10.
Bug: 19657861
Change-Id: Ia68f759103399781a49af23de6356bdfac9c3915
|
| |/
|
|
|
|
|
|
|
|
| |
Use a provider that can handle the provided public-key.
bug: 21816913
(cherry picked from commit cfcb7ad5b68ad854ddbfe5ca1afcf85a1bb61f68)
Change-Id: I581c162f6c57d13e53252fc45ec992b2e217fe81
|
| |
|
|
|
|
|
|
| |
Using Date will interact with timezones, so use milliseconds which
bypasses this.
Bug: 17442302
Change-Id: I6bd73efb95f0f427f31812ce10c32a5af3987ca0
|
| |
|
|
|
|
|
| |
New API for getting the revocation reason. Add tests and exceptions
associated with it.
Change-Id: Ifd6444ab966c984312f069a6ee330d255110ea85
|
| |
|
|
|
| |
Bug: 5239391
Change-Id: I52bd621bd6ed46d1ae01abf1be25d1ac3c76d7e0
|