History log of /libcore/luni/src/test/java/libcore/java/security/cert/X509CertificateTest.java
Revision Date Author Comments
59bfac2da38e56ca76d0d402c32632d1c13a6ab5 21-Jan-2016 Kenny Root <kroot@google.com> Fix algorithm name test

This was incorrect on Android for a long time, but the switch away from
AlgNameMapper fixed it.

Change-Id: Ie59dd4d3bab565e9ef5f61d1dd970f4d26176cbd
ca31a11ec5964600534d7f59b1e827a5bcf683bd 21-Jan-2016 Kenny Root <kroot@google.com> Remove test for AlgNameMapper

This was testing the implementation of AlgNameMapper which is now
removed, so this test is no longer needed.

Change-Id: I9276e92fddcc1d39f1e51007735432022e9347ae
bf1ac91052d6481f670f45aac3c93347b2390d4f 08-Jul-2015 Kenny Root <kroot@google.com> Add tests for alg name aliases

When the OID -> Name mapping was unavailable for a Signature instance,
then the validation was failing to use the OID in Conscrypt when used as
an unbundled library.

Bug: 22365511
Change-Id: I69a4854bb60c84c96b840b3792a8485a303e99bc
4789598724fbf13a5d2e205c939358d9d87f6aef 15-Jun-2015 Alex Klyubin <klyubin@google.com> Fix X509CertificateTest#test_Provider.

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
e4a3071d6f5b8ef0f9d86463524491ce0091c62a 08-May-2014 Neil Fuller <nfuller@google.com> Removing data hacks from ICU root.txt

Previously, the upstream ICU data was modified
to support special short codes (e.g. PST, CET) so that
they were recognized when parsing/formatting in all
locales with SimpleDateFormat.parse()/format().

In an effort to more-closely replicate ICU this change
does *not* introduce special casing for short /
abbreviated names from Java APIs.

This may have impact for applications that use
Date.toString() (but not Date.parse()),
SimpleDateFormat.parse(), SimpleDateFormat.format(),
and anything that uses TimeZone methods that deal in
formatting and zone strings (e.g. getZoneStrings(),
getDisplayName()).

Details:

Date.parse() is unaffected because it handles abbreviated
names only, is not internationalized and contains a set
of recognized strings. Date.toString() is affected because
it relies on SimpleDateFormat for formatting.

ICU still supports abbreviated / short names for
locales where those terms are considered unambiguous for
residents of that locale. For example, "PST" is still parsed /
formatted in Locale.US when using SimpleDateFormat.
However, with this change "PST" will not be parsed/formatted
other locales such as Locale.FRANCE, Locale.UK.

If SimpleDateFormat.format() / TimeZone.getDisplayName() cannot
find a short / abbreviated name for a timezone in the
specified/defaulted locale, then a GMT offset is output as per
the docs.

Of particular note are methods that rely on Locale.getDefault()
and/or Locale.getTimeZone(). Most user-facing usecases are
expected to be unaffected. For example, US users will continue
to see / enter PST. Applications that were previously
parsing a date string containing (for example) PST but relying
on the default locale will start seeing failures.

Most of the changes are in tests that were hardcoding
expected strings or relying on the default locale.

This change is associated with a change in external/icu4c:
I04acd15c62d49c0cf30cc63f60db320bdb8e22e9

This commit also includes minor test changes related to
parsing/formatting dates where the default device locale
is assumed to be US (or other English-speaking locale).
Date-related tests that were relying on the default locale
and broke when it was set to a non-English script are now
explicitly setting it.

Note: The tests all rely on the CtsTestRunner / Vogar
resetting the default Locale / TimeZone between each test.

Bug: 11413756
Change-Id: I9ae6397cf5335ef325aedb6472d0d66a6127e1dd
92e5af3177ac041c3432c6929bb1e59c9d5ea195 23-Apr-2013 Brian Carlstrom <bdc@google.com> Tracking revert of external/bouncycastle DERT61String change 44021512997b337e6079e46fd4230ce979c20b6f

Bug: 8685209

(cherry picked from commit d025181464bba4d7006e730d521c4acb319264cd)

Change-Id: I6d91ecf33a1f98d59dff2fca583a9e02d4002249
d025181464bba4d7006e730d521c4acb319264cd 23-Apr-2013 Brian Carlstrom <bdc@google.com> Tracking revert of external/bouncycastle DERT61String change 44021512997b337e6079e46fd4230ce979c20b6f

Bug: 8685209
Change-Id: I8516bee529cfc6396c3512d3c2db04ebaee2d712
a698d224635ccfe3f141ccf627221271aa53bf69 06-Mar-2013 Kenny Root <kroot@google.com> SigAlgParams and other tests

Add tests for getSigAlgParams using RSA-PSS signatures.

Change-Id: Ib24b75a873dcc2007c6d511c6d307c92391a3f58
b08a5d625a515dc56eb6a02afa2504f09dffe810 16-Jan-2013 Kenny Root <kroot@google.com> Fix getIssuerAlternativeNames() test

The test of "getIssuerAlternativeNames()" actually called
"getSubjectAlternativeNames()" instead.

Change-Id: I9b47bb4f83349157086cb4b70fe930897f38859a
dd94f8009771072a170cdba3fc582c63aaaa5387 16-Jan-2013 Kenny Root <kroot@google.com> Make sure alternativeNames are unmodifiable

Add tests to make sure the Collection<List<?>> instance returned from
getSubjectAlternativeNames and getIssuerAlternativeNames is
unmodifiable. Also test the byte arrays returned are clones of
anything kept long-term.

Change-Id: Ia7564665643e63cb04a264b011eeebaeeed3811f
0d7f656d7d7bdb65531cf97d25060a426d03ae76 08-Jan-2013 Kenny Root <kroot@google.com> X509CertificateTest: test for empty subjectAltNames

If the subjectAltNames field is missing, providers should return null

Change-Id: If11202d97e0a5a41ca598fb7df3320d6a20474c9
b93817d96f599bf8b2ed47dbbefd623c391ddaa3 07-Jan-2013 Kenny Root <kroot@google.com> Track Bouncycastle fixes for subjectAltNames

Change-Id: Ib67395e8ec461feb8f4b1826d18e98d318a157d2
28d504c4188a5d25a7209e4d1c131e0afffa1fcf 07-Jan-2013 Kenny Root <kroot@google.com> Harmony: fix DirName handling in X.509 certs

In SubjectAlternativeName, the directoryName (4) entry is actually a
CHOICE of a single possibility. Harmony was trying to decode it as the
single possibility itself and running into parsing issues.

Additionally, change T61String (TeletexString) handling to assume UTF8
encoding like the RI does.

Change-Id: Ic0b9541dfed21b59940fa50a27cee2e7704d8950
3b14c4bd5c7ce28ed3485bd24285c58424c074af 07-Jan-2013 Kenny Root <kroot@google.com> Harmony: ignore invalid IP in subject alt. names

The RI and other providers will ignore invalid IP lengths instead of
throwing a parsing exception. Bring Harmony in line with those other
providers.

Change-Id: I65715a58614543ab296493829338239cf402ae5d
3b0aee6ea60c14ba1e1e876b511dceb55131770d 07-Jan-2013 Kenny Root <kroot@google.com> Fix Harmony's generateCertificates for empty input

The docs say that if an InputStream does not have any certificates, it
will return an empty collection.

Change-Id: I470c05c097de6c3fa80571294b31cf7ffd10f003
eedd8375f1710162ba9f7b4cd92020c047a87856 04-Jan-2013 Kenny Root <kroot@google.com> X509CertificateTest: test serialization

Serializing and deserializing should work for X509Certificate

Change-Id: Id32df1a50e25e48194702744dce6b9be4fd6929d
e4905fecbdadb33b24f0e9b76f30d15a8d8dbc5b 02-Jan-2013 Kenny Root <kroot@google.com> Test for certificate generation using mark and reset

Make sure that generateCertificate and generateCertificates end at the
right point when using a stream supporting mark and reset.

The support for this seems spotty at best. Various implementations have
broken support in different parts.

Change-Id: Ib8a3f7c451adca4e05fcb3e8409e93c319557497
309e456e6f3b603b50806a24c56abd9fdb3bd7a9 02-Jan-2013 Kenny Root <kroot@google.com> Add test for X509CertificateFactory#generateCertificates

Change-Id: I461881d515201829eae08046574824dbda30d460
9ca3d0733e7f93c140fdc693ffb0aaaa21de7a19 26-Dec-2012 Kenny Root <kroot@google.com> Add X509CertificateTest in libcore tests

Change-Id: I678a8b89d0514c270ce0ee57057cfaadf3b47543