History log of /libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/JarFileTest.java
Revision Date Author Comments
f71c7ea18fdeae6d70009209653ac8626b419292 13-Apr-2016 Sergio Giro <sgiro@google.com> JarFile: make getManifestFromReference and getManEntry synchronized

So that all modifications to the cached manifest entry and to the
underlying JarVerifier are synchronized.

computedHasClassPathAttribute and hasClassPathAttribute are just cached
booleans that don't change once set, unsynchronized access to them would
cause only for them to be computed twice in the worst case.

Also, removed dead code and corresponding test.

Bug: 27826114
Change-Id: Id3a9b74997cb462c625861c0284196f74dcb8e9a
458bfa01aa4dfbe5d4895afc887616a39056f7da 03-Feb-2016 Yi Kong <yikong@google.com> Fix JarFileTest#test_getInputStreamLjava_util_jar_JarEntry_subtest0

This failure is due to OpenJDK has different behaviour when dealing
with JarEntry in getInputStream. If argument 'entry' is of type
JarEntry, it reloads it as JarFileEntry using its file name. Therefore
setting size on 'entry' would be ignored.

We initialize entry as JarFileEntry instead, so that getInputStream sees
our change to JarEntry's size.

Bug: 25996922
Change-Id: I4976db19c4b5ddb5802a3e52af7dc9a9df85aaa1
119d05942e760b078fd8ac1ea133918ec15b8dbe 03-Feb-2016 Yi Kong <yikong@google.com> Fix JarFileTest#test_getInputStreamLjava_util_jar_JarEntry_subtest0

This failure is due to OpenJDK has different behaviour when dealing
with JarEntry in getInputStream. If argument 'entry' is of type
JarEntry, it reloads it as JarFileEntry using its file name. Therefore
setting size on 'entry' would be ignored.

We initialize entry as JarFileEntry instead, so that getInputStream sees
our change to JarEntry's size.

Bug: 25996922
Change-Id: I4976db19c4b5ddb5802a3e52af7dc9a9df85aaa1
ef7f5a16547089a7cdba9e48d780720f606ff54a 13-Nov-2014 Kenny Root <kroot@google.com> JarUtils: stop trying to build chain past candidates length

If the certs in the PKCS#7 bag are in a loop, it will go on forever
trying to build a chain. Instead just stop trying to build the chain
when our chain exceeds the length of the candidates.

Bug: 17972577
Change-Id: If4f92e3eeabe893612a618bab0068a0f8cf75ea9
00bf89dd858de6c7eaca555210ba429a89193722 07-Nov-2014 Kenny Root <kroot@google.com> Switch order of digest and digest encryption algorithm

Sometimes "digest encryption algorithm" would be "RSA" which would match
a Signature provider, but its default setup would be whatever the
provider chose. This works fine with newer algorithms that have a
specific OID for their signature format (e.g., ECDSA and SHA256), but
not with algorithms that just have a generic OID for all possible uses
(e.g., RSA). Stock Android never hits this problem, because nothing
registers a "Signature.RSA" provider, but Spongycastle does so using
JarURLClassLoader after inserting Spongycastle causes a problem.

Flip the order of tries to make this work more uniformly with more JAR
and provider combinations.

(cherry picked from commit b1da6d3df5f9cce6e6d77c63599eba62edb465d6)

Bug: 17790692
Bug: https://code.google.com/p/android/issues/detail?id=68562
Change-Id: I3bb07ea25d7bf1d55fa2466b204594179ac38932
b1da6d3df5f9cce6e6d77c63599eba62edb465d6 07-Nov-2014 Kenny Root <kroot@google.com> Switch order of digest and digest encryption algorithm

Sometimes "digest encryption algorithm" would be "RSA" which would match
a Signature provider, but its default setup would be whatever the
provider chose. This works fine with newer algorithms that have a
specific OID for their signature format (e.g., ECDSA and SHA256), but
not with algorithms that just have a generic OID for all possible uses
(e.g., RSA). Stock Android never hits this problem, because nothing
registers a "Signature.RSA" provider, but Spongycastle does so using
JarURLClassLoader after inserting Spongycastle causes a problem.

Flip the order of tries to make this work more uniformly with more JAR
and provider combinations.

Bug: 17790692
Bug: https://code.google.com/p/android/issues/detail?id=68562
Change-Id: I3bb07ea25d7bf1d55fa2466b204594179ac38932
cdd4aae90277f2182420526c14b9d77a9e7f1203 29-Apr-2014 Kenny Root <kroot@google.com> JarFile: remove tests for chainCheck hidden API, part 2

The hidden API was reverted since the fix is now in
PackageManagerService.

This was PS#2 of the original change, but didn't get uploaded.

Bug: 13678484
Change-Id: Ic488ec5cd7c0d1bf6fb2d7aba16deaee8b6f98a5
fe821d0a3d96518107489e22b37f664632472c41 29-Apr-2014 Kenny Root <kroot@google.com> JarFile: remove tests for chainCheck hidden API

The hidden API was reverted since the fix is now in
PackageManagerService.

Bug: 13678484
Change-Id: I9b5478af9145df82eea01e768d02945f14524bf7
a3d40b4064c0f4de77122eff9253da242877c938 23-Apr-2014 Kenny Root <kroot@google.com> JarFile: Add tests for ambiguous chains

Some chains using the old code will have incorrect splits between
CodeSigner paths.

Bug: 13678484
Change-Id: Ia77b7cbcde9394e0d48a6f082bbd1cdfd880d74b
d32a5c2f44587946ad9d4de26117e45b610b0a6d 23-Apr-2014 Kenny Root <kroot@google.com> Add tests for getCodeSigners

Change-Id: I2bf7449eb72319a547abfd439cabfcc41982d668
19745ce89add193c0e13c18979a3c9fb25bee475 18-Feb-2014 Narayan Kamath <narayan@google.com> DO NOT MERGE Fix another set of file related tests.

- Get rid of Support_PlatformFile, use File.createTempFile
instead.
- Replace numerous uses of "user.dir" / "user.home" etc. with
File.createTempFile
- Replace calls to Process / chmod with Libcore.os.chmod. The
calls wouldn't have worked anyway, since chmod on android
doesn't understand the incremental (+w, -x) syntax.

(cherry picked from commit 2b7c83942a5e28c53698232182193d5118028e6c)

Bug: 13763685
Bug: 13763900

Change-Id: Ic6944568bbee6a548da6dcb4364b882636f2959f
2b7c83942a5e28c53698232182193d5118028e6c 18-Feb-2014 Narayan Kamath <narayan@google.com> Fix another set of file related tests.

- Get rid of Support_PlatformFile, use File.createTempFile
instead.
- Replace numerous uses of "user.dir" / "user.home" etc. with
File.createTempFile
- Replace calls to Process / chmod with Libcore.os.chmod. The
calls wouldn't have worked anyway, since chmod on android
doesn't understand the incremental (+w, -x) syntax.

Change-Id: Ic6944568bbee6a548da6dcb4364b882636f2959f
d567f9025c4b94fc5e9b47f5702c1b48c2a45c96 17-Dec-2013 Narayan Kamath <narayan@google.com> Move tests from harmony/archive to libcore.

Also moves a couple of tests from luni/src/test to
harmony-tests/ where they belong.

Change-Id: I0b441b1fcbd355bd3c66551d16732a671fb64f54