summaryrefslogtreecommitdiffstats
path: root/luni/src
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary IPv6 and IPv4 parsing from URI.Jesse Wilson2010-04-224-752/+476
| | | | Cleanup URI and InetAddress exception localization.
* Merge "Fixing java.lang.NullPointerException at ↵Jesse Wilson2010-04-223-8/+42
|\ | | | | | | java.net.URI$Helper.isValidDomainName" into dalvik-dev
| * Fixing java.lang.NullPointerException at java.net.URI$Helper.isValidDomainNameJesse Wilson2010-04-223-8/+42
| | | | | | | | See http://b/issue?id=2604061
* | java.text.RuleBasedCollator fixes.Elliott Hughes2010-04-222-2/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add expectations for broken harmony tests, add our own equivalent (but correct) tets, and fix the bug turned up by the correct tests: the icu4jni RuleBasedCollator was using toString to convert a CharacterIterator to a String, resulting in iteration over the result of Object.toString (the class name and identity hash code) rather than the characters of interest. Also shut javac up about non-ASCII characters in Locale.java. Bug: 2608742 Bug: 2608750 Change-Id: I2171789058c8116eacd7e5815bd483f0bc07c69b
* | Update to the latest upstream collator tests.Elliott Hughes2010-04-222-0/+86
| | | | | | | | | | | | | | | | | | | | I've pulled out the not-obviously-insane stuff we added, though I don't know how useful it is. This change is mainly about reverting our broken changes to these tests. Bug: 2608750 Bug: 2608742 Change-Id: Ia4d0a7b12bfc5dfc3fad4b72254918acf74b418d
* | am 3825d34f: am d4b6f6aa: am 1dd42bb9: Fix NetworkInterface on sholes/ppp.Elliott Hughes2010-04-211-1/+1
|\ \ | | | | | | | | | | | | | | | | | | Merge commit '3825d34f9cd5057504ced60962638ffb54f14e38' into dalvik-dev * commit '3825d34f9cd5057504ced60962638ffb54f14e38': Fix NetworkInterface on sholes/ppp.
| * \ am 1dd42bb9: Fix NetworkInterface on sholes/ppp.Elliott Hughes2010-04-211-1/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Merge commit '1dd42bb9da388c55191449b848f9d82dc4673229' into kraken * commit '1dd42bb9da388c55191449b848f9d82dc4673229': Fix NetworkInterface on sholes/ppp.
| | * | Fix NetworkInterface on sholes/ppp.Elliott Hughes2010-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to use IFA_LOCAL to get the interface addresses; IFA_ADDRESS is the remote address (which is usually the same as IFA_LOCAL, but not in the ppp case). Tested on sholes, where it fixes the test used in the bug; also tested on passion, where it doesn't break the already-working test. Bug: 2575983 Change-Id: Ib334a002dc099daeeb05cbc341fe233d4d11d2f7
| | * | DO NOT MERGE. Suppressing tests that fail in CTS' test runner.Jesse Wilson2010-04-148-0/+12
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests have been verified to work successfully in run-core-tests. We plan on unifying CTS and Dalvik's test running infrastructure in this quarter so that we don't need such unfortunate hacks. Test failures: http://b/issue?id=2564250 Fix test runner: http://b/issue?id=2215226 Change-Id: I3df2f4de10705dc470e397da2d0f014141573da1
* | | Fix Locale.getDisplayName for unlocalizable languages/countries/variants.Elliott Hughes2010-04-213-10/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | This does not address the interpretation of script identifiers, but does bring us in line with the RI's behavior. That's why the test doesn't use the example from the bug. Bug: 2611311 Change-Id: I54af89aaf418cd520dc6ebdb1e27dc1ac373f70f
* | | Rewrite the HTTP connection pool used by HttpURLConnection.Jesse Wilson2010-04-205-188/+125
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | This started off as incremental changes, but it ended up going far enough that it earned the "rewrite" badge. System.getProperty() is not called for every HTTP connection. This is slightly controversial, but the old code had to bend over backwards to support dynamic pool changes, and it didn't even support the case when the pool shrank but not to 0. The new code doesn't do I/O within static synchronized blocks. This should reduce contention described here: http://b/issue?id=2606547 Also: simpify implementation, prettier names, more focused doc.
* | Fixing TimeZone.setDefault() documentation.Jesse Wilson2010-04-203-559/+239
| | | | | | | | | | | | | | | | | | Set expectations for date formatting to tolerate "GMT-07" in the output. The alternative is to emit an ambigous date string. Applications that want pretty date formatting should use the proper facilities: SimpleDateFormat, etc. This problem was detected by org.apache.harmony.luni.tests.java.util.DateTest.test_toString
* | Fix a BigInteger(String) bug I introduced yesterday.Elliott Hughes2010-04-201-0/+4
| | | | | | | | | | | | I broke parsing of integers in bases greater than 10. Change-Id: I94c4a75c613a1cd8105b7477e68275a81d04d01b
* | Fix several BigInteger failures.Elliott Hughes2010-04-191-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | From Java 7 on, BigInteger also accepts a leading "+" in its string constructors. BigInteger has always claimed to accept non-ASCII digits, but our implementation never has. BigInteger.isProbablePrime is defined to return true for certainty <= 0, but OpenSSL (on which we're based) takes the opposite stance. Change-Id: I00bfc591a4d583460f71b7eec3de91bf6b03cd87
* | Speed up %d for locales with non-ASCII digits.Elliott Hughes2010-04-191-828/+717
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The small "localizeDigits" part of this change is the big speedup. It takes %d in the "ar" Locale from 5x more expensive than "en_US", to just a small percentage more expensive. The big part of this change: removing the useless Transformer and FloatUtils classes touches many lines (mostly just changing the level of indentation), and only has a small percentage effect on performance. The motivation for this is actually primarily that it makes the code easier to read, and makes it easier to share code. Change-Id: I07e86a3ee448510d9ae36579a9af283349f777f1
* | Remove a dangling import, and another unused Messages.java.Elliott Hughes2010-04-181-143/+0
| | | | | | | | | | | | Also tidy up our two awt.font classes. Change-Id: I931d348eef7265190f76c31f74c9a5d9ec5d6597
* | Remove two dead files.Elliott Hughes2010-04-161-75/+0
| | | | | | | | | | | | | | | | java_lang_Character.cpp has long been dead; I killed AndroidSystemNatives.h this afternoon. I'm not sure how their "git rm"s didn't get included in my earlier patch. Change-Id: Iaa73935846a474dbd25792ed0176ccea092e9f7c
* | Move the libcore registration out of libnativehelpers and into libcore.Elliott Hughes2010-04-1617-131/+32
| | | | | | | | | | Bug: 754114 Change-Id: Iaa03def509c10cbaa12fd2128584b93d4be4a6b7
* | Merge LocaleData and Resources, rename Resources to ICU.Elliott Hughes2010-04-168-120/+189
| | | | | | | | | | | | | | Also move our ICU tests into our little tree of tests. Bug: 2596471 Change-Id: I73b53d74c26ef9bf670f12cac58b51ba61eefead
* | merging FRF15 for dalvik-devBrian Carlstrom2010-04-167-0/+10
| | | | | | | | Change-Id: Ic8c9dea280d38cba8e55f962f0d8df843aea8e35
* | Merge "Fixing TreeMap serialization issues." into dalvik-devJesse Wilson2010-04-163-36/+79
|\ \
| * | Fixing TreeMap serialization issues.Jesse Wilson2010-04-153-36/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I was testing this on the JDK I had my own TreeMap on the classpath, which caused my tests to pass even when they shouldn't have. The new serialization data was generated by the JDK's collections, both v5 and v6. The tests pass on both Dalvik and the JDK.
* | | Change DecimalFormatSymbols to have a field per symbol.Elliott Hughes2010-04-162-9/+8
| | | | | | | | | | | | | | | | | | | | | I'd been wanting to do this for some time, but cleaning up the recent performance changes I made to Formatter was the final straw. Change-Id: I6d516de66a0bed5e759bca590b4cc124ce2eb712
* | | Merge "java.util.Formatter: fix localization of numbers." into dalvik-devElliott Hughes2010-04-154-493/+288
|\ \ \ | |/ / |/| |
| * | java.util.Formatter: fix localization of numbers.Elliott Hughes2010-04-154-493/+288
| | | | | | | | | | | | | | | Bug: 2301911 Change-Id: Ic594702a80bdef2e8fd97e52fd5fa301def19cac
* | | Merge "From scratch implementation of a Navigable TreeMap." into dalvik-devJesse Wilson2010-04-156-2371/+1810
|\ \ \
| * | | From scratch implementation of a Navigable TreeMap.Jesse Wilson2010-04-156-2371/+1810
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Between Java 5 and Java 6, Harmony's implementation ballooned from ~2400 lines to ~5900 lines. This implementation is a more compact ~1700 lines. This implementation and its views have been rigorously tested using Google Collections' test framework in addition to the tests of our own suite.
* | | | Merge commit 'da18d995' into manualmergeJesse Wilson2010-04-151-5/+7
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| Conflicts: libcore/luni/src/test/java/tests/api/java/io/PipedInputStreamTest.java
| * | Fixing PipedInputStreamTest to fill the buffer before dying on a dead reader.Jesse Wilson2010-04-131-5/+7
| | | | | | | | | | | | Change-Id: Ie34a8bec7b2a34d2933225d6d4e04e0643dbcf99
* | | Remove "Messages" from the nio, prefs, sql, text, and x-net modules.Elliott Hughes2010-04-1411-337/+96
| |/ |/| | | | | | | | | | | | | | | | | Also remove an file of unused messages from luni, and inline one of luni's other files. (There are plenty more.) Also remove some German translations of bouncycastle messages (that are actually in English anyway). Change-Id: I9c565f6f2201a5d877eba5bf0af4ffad7b769984
* | Use the same documentation in all the methods that take a format string.Elliott Hughes2010-04-134-56/+48
| | | | | | | | Change-Id: I8e7d06df72a7b8db9edd17aa2748800329e837fa
* | Improve documentation about the user's default locale.Elliott Hughes2010-04-137-118/+104
| | | | | | | | | | | | | | | | | | | | Add a bit of text to Locale's class documentation, and include a link from every method that uses Locale.getDefault(). Also try to consistently say "user's default locale", as a subliminal hint that this isn't necessarily the developer's locale, nor en_US. Bug: 2593000 Change-Id: Ieebe864ed6b9fecbfef5d5415269299739cedd1b
* | Fix String.toLowerCase and toUpperCase.Elliott Hughes2010-04-132-165/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than try to cope with Lithuanian, let's just hand that one to ICU4C. I've removed my hand-crafted Azeri/Turkish lowercasing too, in favor of ICU. Presence of a high surrogate (which implies a supplemental character) is a good reason to hand over to ICU too. On the uppercasing side, I've kept our existing hard-coded table and just added code to defer to ICU for Azeri, Lithuanian, and Turkish (plus supplemental characters). I don't like the tables, but I don't have proof that they're incorrect. Bug: 2340628 Change-Id: I36b556b0444623a5aacc1afc58ebb4d84211d3dc
* | Fix supplementary character support.Elliott Hughes2010-04-121-40/+44
| | | | | | | | | | | | | | | | | | | | Fixes all known bugs in our handling of supplementary characters. This change introduces a performance regression on the assumption that it won't be released without a corresponding JIT change to enable the code to be inlined back to pretty much what it used to be. Bug: 2587122 Change-Id: I3449c9718bbe32ebe53b6c10454ae1dc82105b59
* | Throw the same exceptions as the RI from String methods.Elliott Hughes2010-04-101-6/+5
| | | | | | | | | | | | | | | | | | | | | | String has its own StringIndexOutOfBoundsException subclass of IndexOutOfBoundsException. We can run more tests if we behave the same. The RI only admits to IndexOutOfBoundsException, though, so our documentation and throws clause shouldn't change. Change-Id: Ib87777f8a42d4bcac21e8f8f00f4dcbc0ada4201
* | Merge "Make String.split 10x faster." into dalvik-devElliott Hughes2010-04-091-14/+12
|\ \
| * | Make String.split 10x faster.Elliott Hughes2010-04-091-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Almost all uses of String.split in the Android codebase use trivial single literal character separators. This patch optimizes that case to avoid the use of regular expressions entirely. The 10x speedup isn't the whole story, because the speedup is really proportional to the number of separators in the input. 10x is easily achievable, but the speedup could be arbitrarily high. Before: benchmark us logarithmic runtime PatternSplitComma 84.8 XXXXXXXXXXXXXX|||||||||||||| PatternSplitLiteralDot 85.0 XXXXXXXXXXXXXX|||||||||||||| StringSplitComma 166.3 XXXXXXXXXXXXXXXXXXXXXXXXXXXX| StringSplitHard 173.6 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX StringSplitLiteralDot 167.7 XXXXXXXXXXXXXXXXXXXXXXXXXXXX| After: benchmark us logarithmic runtime PatternSplitComma 18.9 XXX||||||||||||||||||||| PatternSplitLiteralDot 19.0 XXX||||||||||||||||||||| StringSplitComma 18.8 XXX||||||||||||||||||||| StringSplitHard 174.2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX StringSplitLiteralDot 18.8 XXX||||||||||||||||||||| (The benchmarks starting "Pattern" use a precompiled Pattern for performance. Those starting "String" use String.split and would traditional entail a temporary Pattern. As you can see, creating Patterns is very expensive for us, and each one throws a finalizer spanner in the GC works too. The new fast path avoids all this. I'll commit the benchmark -- along with all the others I've ever used -- to http://code.google.com/p/dalvik this afternoon.) Tests? We actually pass _more_ tests after this patch, because the increase in performance means we don't hit timeouts. Change-Id: I404298e21a78d72cf5ce6ea675844bf251e3825b
* | | Merge "Latest java.util.concurrent from the JSR 166 project." into dalvik-devJesse Wilson2010-04-095-1/+1831
|\ \ \
| * | | Latest java.util.concurrent from the JSR 166 project.Jesse Wilson2010-04-095-1/+1831
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Code was downloaded from CVS on 2010-april-7 at 10:00pst http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/ The new interfaces and ArrayDeque class are all from Harmony.
* | | | Disable our new javax.net.ssl tests until hangs are resolvedBrian Carlstrom2010-04-091-1/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | While the hangs all seem to happen during handshaking, there is more than one root cause. Until I have things working reliably, disabling the tests to avoid fouling up the continuous build. Change-Id: Ia57cac2e49284a1050a72d9ea77813307eff5ea8
* | | An InlineNative for String.isEmpty, so it's not slower than length() == 0.Elliott Hughes2010-04-081-0/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: benchmark ns logarithmic runtime IsEmpty 115 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX LengthEqualsZero 21 XXXXX|||||||||||||| With C intrinsic: IsEmpty 30 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX LengthEqualsZero 20 XXXXXXXXXXXXXXXXXXXX|||||| With assembler intrinsic: IsEmpty 15 XXXXXXXXXXXXXXXXXXXX|||||| LengthEqualsZero 21 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (All times on passion.) Change-Id: Ifcc37fe7b8efdd377675a448e0085e490d6767bc
* | Fixing javax.net.ssl test failures on RIBrian Carlstrom2010-04-083-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vogar wasn't working at checkin on the host so I couldn't easily retest these changes that came from the code review. Sure enought there were some problems. SSLSocketTest now uses a condition variable to synchronize between the HandshakeCompletedListener and the main thread since the RI does the callback asynchronously. Back to ussing Arrays.equals for comparing Session ID byte[] since Object.equals does not work. Change-Id: I667b60dc065438efe4e3728d7a44b446ebc15e64
* | Fix build by adding missing imports.Elliott Hughes2010-04-061-0/+2
| | | | | | | | Change-Id: I433778b02d3ad67090ee88444700f79b3138d778
* | Merge "Actually use ServiceLoader in places where we had a hard-coded ↵Elliott Hughes2010-04-061-12/+33
|\ \ | | | | | | | | | equivalent." into dalvik-dev
| * | Actually use ServiceLoader in places where we had a hard-coded equivalent.Elliott Hughes2010-04-061-12/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've also removed a file that was causing us to use this code unnecessarily at run-time to explicitly specify the built-in default PreferencesFactory. I haven't touched Charset, but should come back and fix that too at some point. Change-Id: I3a2145041d048078bdb55ae7b8fa4ec9d8726922
* | | Rewrite JSSE code to use one openssl SSL per SSLSocket an one SSL_CTX per ↵Brian Carlstrom2010-04-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSLSessionContext Summary: b/1758225: Revisit OpenSSL locking Removed the locking original put in to address b/1678800 which had been causing problems for the HeapWorker thread which was timing out waiting for the lock in the finalizers while other threads were connecting. b/1678800: Reliability tool: Crash in libcrypto @ https://opac.ntu.ac.uk Properly fixed the native crash by avoid sharing SSL_SESSION objects between SSL_CTX objects Testing: - adb shell run-core-tests --verbose tests.xnet.AllTests - adb shell run-core-tests --verbose javax.net.ssl.AllTests - Test app that reloads https://opac.ntu.ac.uk Details: Each AbstractSessionContext now has an associated SSL_CTX, referenced through the sslCtxNativePointer. SSL_CTX on the native side defines the scope of SSL_SESSION caching, and this brings the Java SSLSessionContext caching into alignment with the native code. OpenSSLSessionImpl now uses AbstractSessionContext instead of SSLSessionContext for access to the underlying SSL_CTX. x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerSessionContext.java Added AbstractSessionContext.putSession so OpenSSLSocketImpl/OpenSSLSessionImpl can directly assign to the current AbstractSessionContext (whether it be a ClientSessionContext or a ServerSessionContext) without casting. x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerSessionContext.java Cleaning up use of SSL_CTX and SSL instances in SSLSocket/SSLServerSocket implementation The major change is that openssl SSL instances are allocated for the life of the matching Java object, replacing the SSL_CTX and the SSL objects that had previously been allocated only starting at handshake time. We should never have been sharing SSL_SESSION instances between SSL_CTX instances, which was the source of the native crashes dating back to cupcake which the OpenSSLSocket.class locking had been preventing. - NativeCrypto now has better defined and independant wrappers on openssl functionality. A followon checkin should move the remaining openssl JNI code here with the intent of being able to write and end-to-end test of the openssl code using NativeCrypto without the JSSE implementation classes. The following gives a list of the new native functions with a mapping to the old implementation code. The new code has a more functional style where SSL_CTX and SSL instances are passed and returned as arguments, not extracted from Java instances SSL_CTX_new OpenSSLSocketImpl.nativeinit, OpenSSLServerSocketImpl.nativeinit, SSLParameters.nativeinitsslctx SSL_CTX_get_ciphers_list OpenSSLSocketImpl.nativeGetEnabledCipherSuites SSL_CTX_free OpenSSLSocketImpl.nativefree, OpenSSLServerSocketImpl.nativefree SSL_new OpenSSLSocketImpl.nativeinit, OpenSSLSocketImpl.init, OpenSSLServerSocketImpl.nativeinit, OpenSSLServerSocketImpl.init SSL_get_options OpenSSLSocketImpl.nativesetenabledprotocols SSL_set_options OpenSSLSocketImpl.nativesetenabledprotocols SSL_get_ciphers OpenSSLSocketImpl.nativeGetEnabledCipherSuites SSL_set_cipher_list OpenSSLSocketImpl.nativeSetEnabledCipherSuites SSL_free OpenSSLSocketImpl.nativefree, OpenSSLServerSocketImpl.nativefree - While the focus in NativeCrypto is on native code, it also contains some helpers/wrappers especially for code that doesn't depend on specific SSL_CTX, SSL instances or that needs to do massaging of data formats between Java and OpenSSL. Some of these had previously been duplicated in the client and server versions of the code. For example: getSupportedCipherSuites OpenSSLSocketImpl.nativegetsupportedciphersuites, OpenSSLServerSocketImpl.nativegetsupportedciphersuites getSupportedProtocols OpenSSLSocketImpl.getSupportedProtocols, OpenSSLServerSocketImpl.getSupportedProtocols getEnabledProtocols OpenSSLSocketImpl.getEnabledProtocols,OpenSSLServerSocketImpl.getEnabledProtocols setEnabledProtocols OpenSSLSocketImpl.setEnabledProtocols setEnabledCipherSuites OpenSSLSocketImpl.setEnabledCipherSuites - Moved JNI initialization from OpenSSLSocketImpl to NativeCrypto which is the future home of all the openssl related native code. clinit OpenSSLSocketImpl.nativeinitstatic - NativeCrypto.CertificateChainVerifier is a new interface to decouple callbacks from openssl from a specific dependence on a OpenSSLSocketImpl.verify_callback method. Changed to return boolean instead of int. - Renamed OpenSSLSocketImpl.ssl to OpenSSLSocketImpl.sslNativePointer for consistency - Changed OpenSSLSocketImpl nativeconnect, nativegetsslsession, nativecipherauthenticationmethod, nativeaccept, nativeread, nativewrite, nativeinterrupt, nativeclose, nativefree to take arguments instead of inspect object state in preparation for moving to NativeCrypto - other notable NativeCrypto changes included * adding SSL_SESSION_get_peer_cert_chain, SSL_SESSION_get_version, and SSL_get_version (and get_ssl_version) which are "missing methods" in openssl * ssl_msg_callback_LOG callback and get_content_type for handshake debugging * removing jfieldID's for our classes now that we pass in values in arguments * changed aliveAndKicking to be volative since we poll on it to communicate between threads * changed from C style declarations at beginning of block to C++ at first use on methods with major changes * stop freeing SSL instances on error, only SSL_clear it * improved session reuse logging when reproducing b/1678800 * change verify_callback to return verifyCertificateChain result x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketFactoryImpl.java When we accept a server socket, we pass the existing SSL state instance from the server socket to the newly accepted socket via the constructor where it is copied with SSL_dup, instead of through both the constructor and later the accept method. x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java Cleaned up nativesetclientauth from using SSL_CTX to SSL, passing ssl as argument in preparation for future movement to NativeCrypto. x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java Removed ssl_op_no cache for rarely used enabled protocol methods so that code could more easily be shared in NativeCrypto between client and server. x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java Changed public getId, getCreationTime, getPeerCertificates, getCipherSuite, getProtocol from being instance methods that looked at the OpenSSLSessionImpl object state to be static mthods that take the native pointers as arguments in preparation for moving to NativeCrypto. Rename session -> sslSessionNativePointer for consistency. Inlined initializeNative, which wasn't really the native code. x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java Removed lock on OpenSSLSocketImpl.class lock from around OpenSSLSocketImpl's use of nativeconnect, nativegetsslsession, and nativecipherauthenticationmethod as well as OpenSSLSessionImpl's use of freeImpl, fixing b/1758225: Revisit OpenSSL locking x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java Unrelated changes Removed unused ssl_ctx, nativeinitsslctx, getSSLCTX x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java Fix bug in both putSession implementations where we cached sessions with zero length id. Also change indexById to pass in id in client implementation. x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerSessionContext.java Make sure we clone SSLParameters passed to the SSLSocketFactory and SSLServerSocketFactory so that muting the client instance does not change the server instance and vice versa. Explicitly set setUseClientMode(false) on the server SSLParameters. These changes are to bring things more into alignment with the original harmony classes which properly support client/server role switching during handshaking. x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketFactoryImpl.java Make locks object fields final x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java Moved updateInstanceCount(1) logic and sslParameters assignment to init method x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java Changed getCachedClientSession to respect getUseClientMode x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java Spelling of listensers to listeners in javadoc x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java Spelling SSLInputStream to SSLOutputStream in comment x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java Changed shutdownInput and shutdownOutput to call to the underlying socket x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java Set sslNativePointer to 0 when freeing underlying SSL object x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java Removed IOException logging in getSession, which is expected to simply return SSL_NULL_WITH_NULL_NULL when there are problems. x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java Disabled "Using factory" message on successful creation of SocketFactory which was a bit noisy running tests. However, added logging in failure case including the related exception: x-net/src/main/java/javax/net/ssl/SSLSocketFactory.java Disabled logging of OpenSSL session deallocation x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp Register SSLContextImpl as a source of SSL and SSL3 SSLContexts, not just TLS and TLSv1. x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java Fix whitespace in comment x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java Change-Id: I99975ae22599c7df0d249fa013ae7ea7c9c08051
* | | resolved conflicts for merge of dd53c703 to dalvik-devElliott Hughes2010-04-0511-88/+59
|\ \ \ | | |/ | |/| | | | Change-Id: Ia95af76e2995ce7fb0778b020baf2882a8b0a3dd
| * | Froyo InputStream.available documentation improvement.Elliott Hughes2010-04-0511-88/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method causes a lot of confusion, and we can do a lot better. (Ideally, the API would either not exist or be something like "public boolean ready()".) I've removed poor-quality documentation overrides too, so the full documentation is visible in most places. (InflaterInputStream is an obvious exception.) Also, to a lesser extent, improve the InputStream.skip documentation. Change-Id: I6d6cd788e6a32ad4a2613d1e381610f1ad8575fe
* | | Remove unnecessary final local variables and arguments from javax.net.ssl testsBrian Carlstrom2010-04-054-157/+157
| |/ |/| | | | | Change-Id: Ie4cbad9335e37f785edab9a76c42c229a1d40f57
* | Merge "New "from scratch" Junit tests for javax.net.ssl" into dalvik-devBrian Carlstrom2010-04-037-0/+1693
|\ \