1. 10 Dec, 2014 1 commit
    • Narayan Kamath's avatar
      Call EVP_CIPHER_CTX_free instead of EVP_CIPHER_CTX_cleanup. · b578b396
      Narayan Kamath authored
      The latter doesn't OpenSSL_free memory allocated by EVP_CIPHER_CTX_new.
      
      It's worth noting that EVP_CIPHER_CTX_free doesn't check the return
      value of EVP_CIPHER_CTX_cleanup so we can't throw if cleanup failed, but
      we were only ever calling this method from a finalizer anyway.
      
      (cherry picked from commit c6465293)
      
      bug: 18617384
      Change-Id: Ida65e14ffbed41f56a59e2f5fe77289cac0f5947
      b578b396
  2. 09 Dec, 2014 2 commits
    • Kenny Root's avatar
      NativeCrypto: empty data content for PKCS7 container · 525df9b1
      Kenny Root authored
      The EncapsulatedContentInfo must be present in the output, but OpenSSL
      will fill in a zero-length OID if you don't call PKCS7_set_content on the
      outer PKCS7 container. So we construct an empty PKCS7 data container and
      set it as the content. This fixes the invalid PKCS7 output.
      
      Bug: 18664989
      Change-Id: I6f4cf785dd02ee40f1951d098fa987aa25d2421a
      525df9b1
    • Kenny Root's avatar
      NativeCrypto: throw BadPaddingException if EVP_CipherFinal_ex fails · e74933ec
      Kenny Root authored
      Since nothing was being pushed onto the stack, no exception was thrown
      in throwExceptionIfNecessary with the constant time fix present in
      1.0.1j. The fix is to throw our own error if nothing was thrown.
      
      Bug: 18621207
      Change-Id: I25e653c493e162c5fda46f320117c013a2661aa4
      e74933ec
  3. 08 Dec, 2014 1 commit
    • Kenny Root's avatar
      OpenSSLCipherRSA: add new reason to exception mapping · 70e75e74
      Kenny Root authored
      1.0.1j introduced a new error reason for RSA padding checks that wasn't
      mapped resulting in a RuntimeException. Add this to the list of reasons
      so we throw the correct BadPaddingException.
      
      Bug: 18665649
      Change-Id: I96ce13f6dee10ca89e74c558ecb338f9dbd907ba
      70e75e74
  4. 05 Dec, 2014 1 commit
  5. 03 Dec, 2014 4 commits
    • Kenny Root's avatar
      Clear SSL state safely · 86dd832a
      Kenny Root authored
      Since SSL_clear can fail, we should clear the OpenSSL ERR stack if it
      does fail. However, to aid in spotting bugs, only clear the stack if the
      SSL_clear itself fails.
      
      Bug: 18570895
      Change-Id: I053d2e2792e64923c1e128b4fcae23b2e660a992
      86dd832a
    • Kenny Root's avatar
      OpenSSLSocketImpl: remove unneeded import · f76cd5b3
      Kenny Root authored
      Change-Id: I3ccab83a36ba016bd1bf9068a90b1afbf2aea7ed
      f76cd5b3
    • Narayan Kamath's avatar
      Return BUFFER_UNDERFLOW if no source bytes were consumed. · ba3e8b69
      Narayan Kamath authored
      ... either during the handshake or after. With this change, we're
      backward compatible with older versions of android. Note that newer
      versions of apache-http rely on this behaviour.
      
      bug: 18554122
      
      (cherry picked from commit 6a1b7a85)
      
      Change-Id: I741d2585548b3d72abae2b696eee2a186e58414c
      ba3e8b69
    • Narayan Kamath's avatar
      Fix OpenSSLSocketImpl.getPort when SNI is used. · 534de4ef
      Narayan Kamath authored
      We were using a non-null hostname as a hint that the socket was
      constructed with an explicit host and port. This is no longer true
      because the hostname can be non-null when SNI is used (i.e setHostname
      is called with a non-null hostname).
      
      bug: 18428603
      
      (cherry picked from commit 13164097)
      
      Change-Id: I5a76a17259e4f50a0b8a29b37a647265a755e326
      534de4ef
  6. 26 Nov, 2014 6 commits
    • Kenny Root's avatar
      Convert EC_GROUP and EC_POINT to new style · 7dc06b9e
      Kenny Root authored
      Bug: 16656908
      Change-Id: Ie912f376f69327ce634cac50763bf86b418049f5
      7dc06b9e
    • Kenny Root's avatar
      Switch EVP_CIPHER_CTX to new style · 4757cdbe
      Kenny Root authored
      Bug: 16656908
      Change-Id: Id519c20474a02c70e72d362bc84d26855a74fa33
      4757cdbe
    • Kenny Root's avatar
      Restore EVP_CIPHER_CTX_set_key_length · 153fd44b
      Kenny Root authored
      During the compatibility with BoringSSL change, this appears accidentally
      removed without removing any of the references from NativeCrypto.java
      or OpenSSLCipher.java
      
      Change-Id: I7fe686b367994f127675b076ab49712767203f49
      153fd44b
    • Kenny Root's avatar
      Convert EVP_PKEY to new style · 37e58bbe
      Kenny Root authored
      To avoid conflicts in the language spec and how Conscrypt does native
      calls, we need to wrap all native references in a Java object reference.
      Calling NativeCrypto's static native methods with a raw pointer doesn't
      guarantee that the calling object won't be finalized during the method
      running.
      
      This pass fixes EVP_PKEY references, but more passes are needed.
      
      Bug: 16656908
      Change-Id: I5925da40cb37cd328b3a126404944f771732a43e
      37e58bbe
    • Kenny Root's avatar
      Fix JNI_TRACE · 6c523c0e
      Kenny Root authored
      The update to BoringSSL broke some of the tracing messages, so fix their
      formatting to compile correctly with warning on.
      
      Change-Id: I6c7a1e0069b61a787d9e00b929a6c4fa4358a063
      6c523c0e
    • Kenny Root's avatar
      NativeRef: add pointer-based equality · 659ec6ad
      Kenny Root authored
      Change-Id: I5ecaa9ce3f5cc6fe8728f7811fcc965f46f1e942
      659ec6ad
  7. 25 Nov, 2014 2 commits
    • Kenny Root's avatar
      Convert EVP_MD_CTX to new style · 4bff0a15
      Kenny Root authored
      To avoid conflicts in the language spec and how Conscrypt does native
      calls, we need to wrap all native references in a Java object reference.
      Calling NativeCrypto's static native methods with a raw pointer doesn't
      guarantee that the calling object won't be finalized during the method
      running.
      
      Bug: 16656908
      Change-Id: I165e041a8fe056770d6ce6d6cd064c411575b7c4
      4bff0a15
    • Kenny Root's avatar
      Remove Conscrypt support for DSA · e84805ba
      Kenny Root authored
      BoringSSL removes support for DSA, so there's no point in maintaining
      this now. There have been virtually zero SSL certificates issued using
      DSA for many years as well.
      
      Change-Id: Id940643b85ba39b03038aabc6da9ec0285db66c4
      e84805ba
  8. 24 Nov, 2014 2 commits
  9. 22 Nov, 2014 1 commit
  10. 21 Nov, 2014 1 commit
  11. 20 Nov, 2014 3 commits
  12. 19 Nov, 2014 2 commits
    • Kenny Root's avatar
      OpenSSLRandom: restore parts for OpenSSL · 4f81d311
      Kenny Root authored
      BoringSSL reads /dev/urandom directly, so these calls aren't needed.
      However, OpenSSL needs these calls in some instances to protect against
      other things going wrong elsewhere.
      
      Restore the previous code until BoringSSL is in the tree.
      
      Change-Id: I55624e0d98b04e9f5411f69e13a70a78fa0c0d7f
      4f81d311
    • Adam Langley's avatar
      Allow conscrypt to work with BoringSSL. · de5225d1
      Adam Langley authored
      This is quite a substantial change because of the changes to ENGINEs in
      BoringSSL.
      
      For the most part, #ifs are used to allow the code to work with either
      OpenSSL or BoringSSL. However, in several places, support for things
      that BoringSSL is dropping have been removed, even when OpenSSL is used.
      This includes DSA keys and tests for the ENGINE bits that are going away
      because it's unclear how to skip compiling those tests.
      
      Change-Id: I941a5ed232391f84b45e070c19d2ffb7ad162b7b
      de5225d1
  13. 18 Nov, 2014 1 commit
    • Alex Klyubin's avatar
      Remove support for DSS TLS/SSL cipher suites. · e53baea9
      Alex Klyubin authored
      This is in preparation for migration from OpenSSL to BoringSSL.
      BoringSSL does not support DSS.
      
      DSS cipher suites are used by a vanishingly tiny fraction of the
      Android ecosystem. In all cases, the server's SSL certificate is
      self-signed (rather than CA issued), making it easy to switch to
      a new self-signed certificate which is based on RSA or ECDSA.
      
      Bug: 17409664
      Change-Id: I91067ca9df764edd2b7820e5dec995f24f3910a1
      e53baea9
  14. 17 Nov, 2014 2 commits
    • Alex Klyubin's avatar
      Fix null elements in X509KeyManager.chooseClientAlias keyTypes. · b9bfe69f
      Alex Klyubin authored
      This fixes an issue where client certificate types requested by the
      server from the client, but not known by the client, manifest
      themselves as null elements in X509KeyManager.chooseClientAlias
      keyTypes argument.
      
      The root cause was that for each element in the
      CertificateRequest.certificate_types array an element was output into
      the keyTypes array. For unknown values of certificate_type, a null
      was output.
      
      This CL fixes the issue by ignoring unknown values in
      certificate_types array.
      
      Bug: 18414726
      Change-Id: I8565e19a610c0ecfb7cab1b7707c335e0eeb8d89
      b9bfe69f
    • Kenny Root's avatar
      Preserve errors to get the correct exception · 2ba24c83
      Kenny Root authored
      During the switch to BoringSSL, agl noticed the error state wasn't being
      preserved correctly. Integrate part of the BoringSSL change to preserve
      error states.
      
      Bug: 18388980
      Change-Id: I9a6fea4f3bf457808a337604290c6bfd1b9ea84e
      2ba24c83
  15. 14 Nov, 2014 1 commit
  16. 11 Nov, 2014 2 commits
    • Alex Klyubin's avatar
      Enable SNI by default in platform-bundled Conscrypt. · d7457552
      Alex Klyubin authored
      The benefit of enabling SNI by default is that is makes it easier to
      setup/move to virtual hosting, and also use more specific/restricted
      SSL certificates without having to modify clients.
      
      SNI is so widely deployed these days that it is not expected to cause
      any significant issues by being on by default. Moreover, it's on by
      default in the RI.
      
      Bug: 16658420
      Change-Id: I0d5d13152ffcc3cf1e01afe7a45f69e7aaf6d4bc
      d7457552
    • Kenny Root's avatar
      a5fe9ce8
  17. 10 Nov, 2014 2 commits
  18. 07 Nov, 2014 1 commit
  19. 04 Nov, 2014 1 commit
  20. 03 Nov, 2014 4 commits