Fix PasswordCallback serialization test.

The object doesn't override equals & hashCode so it needs
a serialization comparator.

Change-Id: Ie6067ad1e6cd22f5e2b83907e5bf2ea0039466cb
Merge "Fix PasswordCallback serialization test."
Better way to export variables in Docs.mk.

With this change, libcore_to_document will be evaluated only once.
As a side effect, this fixes the build log spam reported in:
https://code.google.com/p/android/issues/detail?id=63184

Change-Id: I4fcfbcd70f6d4b119487525825aeafa2926507b4
Fix Cipher doc.

Duplicated words in the doc.

Change-Id: Ic400197781f1dea114e3755dc630c8dc58696fc2
Signed-off-by: Xizhi Zhu <xizhi.zhu@gmail.com>
Merge "Fix Cipher doc."
Used constant time comparison to avoid timing attacks.

The previous implementation leaves a chance for timing attacks.

Change-Id: I7db4ca25de0ed89723af37655e1a25e15750fd31
Signed-off-by: Xizhi Zhu <xizhi.zhu@gmail.com>
Merge "Used constant time comparison to avoid timing attacks."
Merge "Better way to export variables in Docs.mk."
Late binding: Provider.Service#supportsParameter

First step in late-binding support. This will be used later to support
late binding by rejecting possible providers using the supportsParameter
call.

This allows security providers to specify attributes in their
registration that allow the Security framework to filter them out
earlier instead of failing on instantiation. The attributes supported in
this change are SupportedKeyClasses and SupportedKeyFormats.

Change-Id: Iee954e2b6c95c41d3b45aa738e869471fbe14341
Merge "Late binding: Provider.Service#supportsParameter"
Fix Signature#getInstance.

The returned class didn't override the full set of
SignatureSpi methods, meaning that some method calls
wouldn't be sent down to the SPI delegate.

Also add some missing @Override annotations, remove
pointless comments and make a private field final.

bug: https://code.google.com/p/android/issues/detail?id=63139
Change-Id: I00762213a4afad0dc69e385105043b01aa77bb95
Merge "Fix Signature#getInstance."
Add a JNI wrapper over libziparchive.

All functions delegate directly to the native code. We
do not perform any sort of central directory or local file
related lookups in the java layer.

For each entry, libziparchive gives us an offset to the start
of data for the entry and the compressed size. We use a
RandomAccessFile to seek to that offset and then construct an
InputStream that's bounded between [offset, offset + compressed_size).

We reuse existing code (JarVerifier / Manifest) for certificate
validation & collection.

bug: 10193060

Change-Id: I21eb4e6dc6aa8749e3f63830f9799e1f621d26e6
Merge "Add a JNI wrapper over libziparchive."
Add regression tests for gbk encoding.

Issues are already fixed on ToT, but these are useful test cases.

bug: https://code.google.com/p/android/issues/detail?id=63188
Change-Id: I692d77dbc0173dea540cfcca8f1915ecba290878
Catch more system calls that result in disk I/O.

Change-Id: If3d941154c658bd87ed968ae4d40cfb6806242ce
Late binding: address review comments

The parameter could still be null at this point, but it should not be
accepted since null obviously wouldn't match one of the given key
classes or formats.

Change-Id: I0ab4d6dc0d805232bf1b487320802b7a910ccc16
Merge "Late binding: address review comments"
Late binding: supportsParameter is not newInstance

newInstance should not call supportsParameter since they're not the same
thing. It is type-specific how the parameter is used, so it's not
necessarily the parameter used for the constructor.

The constructor type supplied to newInstance is only used for CertStore,
but CertStore does not support the supportsParameter call. This was
causing CertStore-related tests to fail since newInstance called into
supportsParameter.

Additionally, to make sure we throw the correct exceptions, we need to
keep a list of valid parameters for all the types we know about. Right
now this just means moving the special case that existed before into a
HashMap and adding null entries for the other types we know about.
Adding the null types allows the disambiguation from types we don't know
about so we can throw an exception when a constructor parameter is
supplied to a type that should not take one.

Change-Id: Ia1755481df1bfa9f76dc4cf7eee5c966a8019396
Merge "Late binding: supportsParameter is not newInstance"