summaryrefslogtreecommitdiffstats
path: root/luni/src/main
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Rename our 'realpath' because it isn't the same as realpath(3).Elliott Hughes2014-01-314-162/+163
| |/ / | | | | | | | | | Change-Id: I7b830d485c1ff769993233b7ea69e36b354f3259
* | | CryptoProvider: remove duplicate algorithmsKenny Root2014-01-317-1393/+5
| | | | | | | | | | | | | | | | | | | | | No one ever uses these. They are not the default anymore and haven't been for several releases. Change-Id: Ieff7c31b31f492107e6ee4d7e9e5aeb8893a0c4d
* | | Remove DRLCertFactoryKenny Root2014-01-319-2809/+6
| | | | | | | | | | | | | | | | | | No longer needed since Conscrypt is the main provider. Change-Id: I6cee3c33c00822cc320780d63cb76f42e6be2b71
* | | X509CRLImpl: add generics!Kenny Root2014-01-311-10/+10
| | | | | | | | | | | | | | | | | | Remove all the warnings in my IDE with newfangled generics. Change-Id: I7ee4b273c36db31bf318e56ab79e48fe963020e5
* | | X509CRLImpl: fix getRevokedCertificate by serialKenny Root2014-01-311-4/+14
|/ / | | | | | | | | | | | | The getRevokedCertificate(BigInteger) was scanning nonIndirectEntries, but it didn't check "isIndirectCRL" first. Change-Id: Ib1ca31d563c6bd9c62901a9eae9bea1bd92a1d9b
* | Merge "Refactoring in preparation for NIO2 changes."Neil Fuller2014-01-3011-291/+553
|\ \
| * | Refactoring in preparation for NIO2 changes.Neil Fuller2014-01-2911-291/+553
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Making the various Socket/Channel classes more consistent with each other for synchronizing state between the Channel, Socket and the OS. This is in preparation for NetworkChannel.bind(). Synchronizing state revealed a test that relied upon a Socket from a channel not reporting isConnected() properly after a connect(). Tests have been updated. Reading the local address back from the OS revealed that Android is using IPv6 and reports the string equivalent of IPv4's 0.0.0.0 as "::". Updated a test that was relying on the string form. Calling connect() twice on a DatagramSocket appears inconsistent with itself and Channel and other Sockets. A pure DatagramSocket switches over to the new remote address. I have changed the Channel-backed DatagramSocket to throw an IllegalStateException exception, and have created a bug to discuss making the calls more consistent. Socket has been modified to avoid using the address field to store the local address after a bind(). This field is documented as holding the remote address, not the local. Changed implementation of SocketChannelImpl.socket().getInputStream() and SocketChannelImpl.socket().getOutputStream() to use the one that is implemented by Socket and not a custom NIO-based implementation. The use of NIO provided two parallel implementations for the same thing. This change alters behavior when attempting to read zero bytes and when a Channel is in non-blocking mode: now it throws IllegalBlockingModeException rather than ArrayIndexOutOfBoundsException. The tests have been updated. Various tidying up changes to introduce @Override, remove unnecessarily initialized local variables, fields, semi-colons, javadocs and imports. Added close() calls for objects during tests that were cluttering the logs. Modified IoBridge.connect() to be void. Adjusted SocketChannelImpl accordingly and tidied up impossible cases. Modified SocketChannel.connect() so that it always returns false in non-blocking mode. This looks like an existing bug: it would previously have returned true, even though the connection was potentially still pending. Tests have been added. Also tidied up SocketChannelImpl.finishConnect() - it was potentially resetting the isBound state. Change-Id: Ic7943615b4b763f77e74397e0e91a62edc7d7017 bug: 12464155
* | | Introduction of SeekableByteChannel.Neil Fuller2014-01-302-106/+184
| | | | | | | | | | | | | | | | | | | | | | | | Note: FileChannel continues to implement ByteChannel for now. Otherwise the API is visibly changed because SeekableByteChannel is hidden. Change-Id: If20c8c211e0a1f6003763ac702b2e2f8ad37e293
* | | Merge "Fixing FileChannel.truncate() / position()"Neil Fuller2014-01-292-1/+4
|\ \ \
| * | | Fixing FileChannel.truncate() / position()Neil Fuller2014-01-272-1/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the docs, after calling truncate(x), if position() > x, position() should be made to equal x. Note: It is to be set to x, not to the actual size of the file, since truncate() doesn't actually grow the file. Subsequent writes will grow the file to position(). Bug: 12757843 Change-Id: I5df1fbd59f1a8610bc60575dfa7f1396baf3ed47
* | | Fix Matcher.group documentation.Elliott Hughes2014-01-283-136/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that any @param or @return gunk gets inherited even if you supply new body text. So fix MatchResult's javadoc and make it clear that Matcher just inherits. (I'm not sure I even knew MatchResult existed.) Bug: https://code.google.com/p/android/issues/detail?id=64643 Change-Id: Iee86a026a2b72676af9c54627525bceb482b9f63
* | | Fix javadoc for Character.UnicodeScript.Narayan Kamath2014-01-201-1/+3
| | | | | | | | | | | | | | | | | | | | | - Fix missing whitespace between @code and its contents - Add a @since tag. Change-Id: I0faad6971285a20c6988da434e376515acb5bd0b
* | | Merge "java7: Implement new Locale APIs."Narayan Kamath2014-01-174-58/+1532
|\ \ \
| * | | java7: Implement new Locale APIs.Narayan Kamath2014-01-174-58/+1532
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most validation and sanity checking is performed entirely in java. We use ICU only for converting back and forth between Locale objects and BCP-47 language tags (toLanguageTag & forLanguageTag). The new APIs also add support for script subtags and manipulation of unicode locale extensions. Note that we do not implement IllformedLocaleException.getErrorIndex. If anyone complains or if it proves useful somehow, we could plumb the information through from ICU if required. bug: 8992787 Change-Id: I9b2d7f8d17f970d1b57111dcfe92c16e68b0fa67
* | | | Merge "Fix encodings in X500PrincipalTest"Kenny Root2014-01-163-11/+88
|\ \ \ \
| * | | | Fix encodings in X500PrincipalTestKenny Root2014-01-143-11/+88
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As said in AttributeValue, DC and emailAddress should be encoded in IA5String as specified by RFC5280. Also the canonical encoding of a T61String could be PrintableString when the string is only 'A' according to b/2102191 but this could be a mistake. Consecutive spaces and leading and trailing runs of spaces should be escaped for RFC 1779. Also the RFC 2259 doesn't specify anything other than the beginning or end spaces, but the RI escapes the beginning and ending runs of spaces. Bug: 12490346 Bug: 12490876 Change-Id: I6591156ba0a27a894241b039570488f89c885242
* | | | CipherInputStream: increase buffers for speedKenny Root2014-01-152-30/+52
|/ / / | | | | | | | | | | | | | | | | | | This increases speed of CipherInputStreamBenchmark from 606ms to 28.5ms. Bug: 12246774 Change-Id: If61c0a055fe1b8e87909711b15d0441fcdbe46c7
* | | Merge "java7: Implement Character.UnicodeScript"Narayan Kamath2014-01-132-8/+453
|\ \ \
| * | | java7: Implement Character.UnicodeScriptNarayan Kamath2014-01-132-8/+453
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented in terms of u_getPropertyValueEnum(UCHAR_SCRIPT,) and uscript_getScript from ICU4C. Since the Java 7 API specifies a subset of scripts known to ICU4C, we map scripts not specified in the API to UnicodeScript.UNKNOWN. Like the UnicodeBlock API, our matching is far more lenient than the RI. Change-Id: I5247baddb2dde42d6a2042609370daeb616fe419
* | | | Merge "Invalidate DirectByteBuffers when freed."Calin Juravle2014-01-133-2/+94
|\ \ \ \ | |/ / / |/| | |
| * | | Invalidate DirectByteBuffers when freed.Calin Juravle2014-01-103-2/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to DirectByteBuffer#free() will invalidate the buffer: - isValid() will return false; - subsequent operations which touch the inner buffer will throw IllegalStateException. Note: NioUtils#freeDirectByteBuffer can also be used to invalidate the buffer. Bug: 11512044 Change-Id: I78e00dc12b0dbfbd1be6af28bef2413053fb15cb
* | | | Merge "Improve the Matcher documentation."Elliott Hughes2014-01-101-31/+5
|\ \ \ \ | |/ / / |/| | |
| * | | Improve the Matcher documentation.Elliott Hughes2014-01-091-31/+5
| |/ / | | | | | | | | | | | | Bug: https://code.google.com/p/android/issues/detail?id=64643 Change-Id: Iae7f8faa10c23bd82dbc1466fb3aea2d2db07f16
* | | Removing the nestedException field from ObjectOutputStream.Neil Fuller2014-01-101-35/+13
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The creation of the StreamCorruptedException in the constructor adds expense. A common usage of ObjectOutputStream in Android is to write Serializable objects into a Parcel, which uses a ByteArrayOutputStream and should never fail with an IOException. This change should provide a small speed up and reduce memory usage for the common case. StreamCorruptedException is intended for use when reading from an ObjectStream and it is no longer used. Also, by throwing a new exception the root cause (either the original failure, or of the failure to write the exception to the output stream) is obscured. Of the two possible exceptions that could be thrown it seems best to throw the original and swallow the second. Added documentation. Small risk of externally visible changes if callers are depending on the exact class of the exception thrown but the use of StreamCorruptedException is not documented and is unlikely to break anybody. Also tidying up other simple code problems: 1) Unused parameter on writeEnumDesc() 2) Removing the getFieldL native method. It is never called and does not appear to be backed by any native code. 3) Removing unnecessary initialization of local variables. bug: 6447733 Change-Id: If062aa8d376019ed0c8db969e8161f18898e64e5
* | GZIPInputStream: avoid leaks in init.John Spurlock2014-01-071-6/+11
| | | | | | | | | | | | | | If we throw inside the ctor, it is impossible for clients to pass the CloseGuard test for the associated Inflater. Change-Id: I6c4e66a98742fbd15bcdd03aa03e2fa7e33e110b
* | Merge "Move DeleteOnExit to libcore.io."Narayan Kamath2013-12-202-8/+12
|\ \
| * | Move DeleteOnExit to libcore.io.Narayan Kamath2013-12-202-8/+12
| | | | | | | | | | | | | | | Also makes the constructor private & a field final. Change-Id: I1df833cee5f4217bd800c36104da2a76a1f1877d
* | | Allow multiple gzip members in gzip streams.Narayan Kamath2013-12-202-54/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We look for the gzip magic bytes at the end of every member and try to decompress the remainder of the stream if we find it. Note that this changes the behaviour of this class wrt. the underlying stream: It is no longer self limiting. It will attempt to read past the gzip trailer to look for more data to decompress. Before this change, it would've been possible to (hackily) consume the rest of the compressed stream directly by inspecting the value of InflaterInputStream.inf.getRemainingBytes(). It's no longer possible to sensibly support that. bug: https://code.google.com/p/android/issues/detail?id=63873 Change-Id: I818f77c052a811ed98b76243f2ad8a1a4d236d70
* | | Disable MD5 cipher suites in SSLSocket and SSLEngine.Alex Klyubin2013-12-191-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | Although HMAC-MD5 is not yet broken, the foundations are shaky -- see http://tools.ietf.org/html/rfc6151. Scans show that disabling these TLS/SSL cipher suites currently causes handshake issues with 0.4% of the ecosystem. Bug: 11220570 Change-Id: I1970d2ecbdf3c0d26e45d439047b1d3884ade2ec
* | Make DeflaterInputStream#available more consistent.Narayan Kamath2013-12-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - We now guarantee that available() returns 0 iff. deflater.finished() == true. Note that this is still inconsistent with the specification of InputStream#available. - Remove an unnecessary array copy in DeflaterInputStream#read. - Remove tests that expect an IllegalArgumentException for negative skip count values. The InputStream spec doesn't mandate that we must throw here, and it's better to be consistent with every othem InputStream specialization in the code. - Remove obsolete failures from brokentests.txt. bug: 12189307 Change-Id: Ie9b1ad5d7c050b005b5f6f44a5a283bfdaeb1e81
* | Disable 3DES cipher suites in SSLSocket.Alex Klyubin2013-12-181-7/+7
| | | | | | | | | | | | | | | | | | | | | | The effective key length for 3DES_EDE bulk encryption algorithm is only 112 bits. We're now aiming for 128 and higher. Scans show that removing these cipher suites from the default list causes handshake issues only with 0.15% of the ecosystem. Bug: 11220570 Change-Id: Ie01ebe8134d08a36b276295b804540157963be8f
* | Merge "Disable static server key ECDH cipher suites in SSLSocket."Alex Klyubin2013-12-181-8/+8
|\ \
| * | Disable static server key ECDH cipher suites in SSLSocket.Alex Klyubin2013-12-171-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These cipher suites use a static key for ECDH on the server side. When client certificates are used, a static key is also used on the client side, leading to the same premaster secret for all connections between a particular client and server. Also, these cipher suites do not provide forward secrecy. Scans show that removing these cipher suites from the default list does not affect connectivity to servers and is thus safe. Bug: 11220570 Change-Id: If34f4a3888ed9972c39d171656a85c61dfa98ea1
* | | Throw an NPE in a more obvious manner.Narayan Kamath2013-12-181-1/+6
|/ / | | | | | | | | | | | | Also remove tests with broken expectations that were never implemented. Change-Id: I5eb60d3e6dfb8ead6e23941fca1bc19f79c4a158
* | Enable AES-GCM cipher suites by default in SSLSocket.Alex Klyubin2013-12-171-9/+9
| | | | | | | | | | | | | | | | AES-GCM is preferred to AES-CBC whose MAC-pad-then-encrypt approach has issues (e.g., Lucky 13 attack). Bug: 11220570 Change-Id: Ib007bc89ccf08358ed3f093f630350fa859e7c35
* | Enable support for TLSv1.2 cipher suites in SSLSocket.Alex Klyubin2013-12-171-0/+165
| | | | | | | | | | | | | | | | This adds support for AES-GCM and AES-CBC with MACs based on SHA256 and SHA384. Bug: 11220570 Change-Id: I56e7e25c5cd65a4c7662da6d4bbe5720f427e677
* | Enable TLSv1.1 and TLSv1.2 by default for SSLSocket.Alex Klyubin2013-12-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TLSv1.1 and TLSv1.2 offer built-in protection against BEAST attack and support for GCM cipher suites. This change causes TLS/SSL handshake failures with a small fraction of servers, load balancers and TLS/SSL accelerators with broken TLS/SSL implementations. Scans demonstrate that the number is around 0.6%. Breaking connectivity (using platform default settings) to a tiny minority of the ecosystem is acceptable because this inconvenience is outweighed by the added safety for the overwheling majority of the ecosystem. App developers affected by this issue should consider asking such servers to be fixed or explicitly disabling TLSv1.1 and TLSv1.2 in their apps. Bug: 11220570 Change-Id: Ice9e8ce550401ba5e3385fd369c40f01c06ac7fd
* | Merge "Remove HarmonyJSSE SSLContext, SSLSocket and SSLServerSocket."Alex Klyubin2013-12-161-4/+4
|\ \
| * | Remove HarmonyJSSE SSLContext, SSLSocket and SSLServerSocket.Alex Klyubin2013-12-161-4/+4
| | | | | | | | | | | | Change-Id: I3c939e9275ba8f1d00342d1f83c6fdaf110f2317
* | | Late binding: add support to CipherKenny Root2013-12-165-176/+330
|/ / | | | | | | | | | | | | | | | | This enables late binding support for Cipher algorithms. It will now pay attention to SupportedKeyClasses and SupportedKeyFormats after the Cipher#init(...) is called on the instance instead of selecting the provider when Cipher#getInstance(...) creates the instance. Change-Id: I27802f1f8b96d81dd2a269741d080dbe68232c9f
* | Javadoc protocols and providers supported by SSLContext.Alex Klyubin2013-12-131-0/+113
| | | | | | | | Change-Id: I1ceb0d6d2d8c4f90a40865aa375fd7d93ddd4389
* | Javadoc the default configuration of SSLEngine.Alex Klyubin2013-12-121-0/+280
| | | | | | | | | | | | | | | | The Javadoc of javax.net.ssl.SSLEngine now lists the protocols and cipher suites supported and enabled by default. Bug: 11220570 Change-Id: I6e365d58bfe2ddf60bae9dc7ccd0a33249e9e125
* | Merge "Javadoc the default configuration of SSLSocket."Alex Klyubin2013-12-121-0/+506
|\ \
| * | Javadoc the default configuration of SSLSocket.Alex Klyubin2013-12-111-0/+506
| | | | | | | | | | | | | | | | | | | | | | | | The Javadoc of javax.net.ssl.SSLSocket now lists the protocols and cipher suites supported and enabled by default. Bug: 11220570 Change-Id: I3b6a96a86618370a55abf3307cbaadd1a1587066
* | | Merge "Fix a CharsetEncoder bug."Narayan Kamath2013-12-121-1/+11
|\ \ \
| * | | Fix a CharsetEncoder bug.Narayan Kamath2013-12-121-1/+11
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When malformed or unmappable characters span input buffers, we'd end up setting a negative position on the buffer. Also fix up a few test cases which were wrong in several ways. - One test was simply checking for the wrong sort of exception (unmappable vs malformed) - Another test was expecting encode() to throw an error (and ignoring flush) but the API allows flush to throw an error instead of encode. bug: 10729779 Change-Id: I6560b749ca2445651d61ca651f8a5e388cf1c1b0
* | | Fix a read/write typo.Elliott Hughes2013-12-111-1/+1
| | | | | | | | | | | | | | | Bug: https://code.google.com/p/android/issues/detail?id=62726 Change-Id: I1113be8745da7bc17c22057e0be78411dd66a745
* | | Remove blockguard check for getaddrinfo.Narayan Kamath2013-12-111-5/+0
|/ / | | | | | | Change-Id: Ia45aa76e42b06d7ed405d7a2f6851658fec0bff0
* | Merge "Catch more system calls that result in disk I/O."Narayan Kamath2013-12-101-0/+91
|\ \
| * | Catch more system calls that result in disk I/O.Jeff Sharkey2013-12-091-0/+91
| | | | | | | | | | | | Change-Id: If3d941154c658bd87ed968ae4d40cfb6806242ce