1. 22 Jun, 2015 5 commits
  2. 17 Jun, 2015 1 commit
  3. 11 Jun, 2015 12 commits
    • Kenny Root's avatar
      Fix compilation with OpenSSL · 199a1346
      Kenny Root authored
      (cherry picked from commit d9a48aa4)
      
      Bug: 21034231
      Change-Id: I1efd062a6608111e6ab468f4e362291895dd166d
      199a1346
    • Kenny Root's avatar
      Fix error conditions in certificate/PKCS#7 reading · ccb8225a
      Kenny Root authored
      When an error condition is encountered in BoringSSL, sometimes it
      deliberately does not put something on the ERR stack to prevent abuse of
      that knowledge. Instead we need to throw an exception explicitly when no
      error is pushed onto the stack.
      
      (cherry picked from commit 79f05f46)
      
      Bug: 21034231
      Change-Id: Ia06347c5653672c982ecff2c26be9b091d03009f
      ccb8225a
    • Kenny Root's avatar
      d6828c47
    • Kenny Root's avatar
      Fix up JNI_TRACE for AEAD · 203afd81
      Kenny Root authored
      (cherry picked from commit edc4f273)
      
      Bug: 21762837
      Change-Id: I11042be8fe1e046ac96759b4554ce9229e1cf6f3
      203afd81
    • Kenny Root's avatar
    • Sergio Giro's avatar
      OpenSSLCipher: adjust expected length with padding in decrypt mode · 1127c196
      Sergio Giro authored
      - Consider the |final| buffer when computing the expected length
      - Should not expect an extra block when using padding in decrypting
      mode
      
      Bug: 19186852
      Change-Id: I8c51b309ca98030ab1eda5b2a0201a97a5758072
      
      (cherry-pick from 8fa4acdc)
      1127c196
    • Kenny Root's avatar
      dc51d744
    • Alex Klyubin's avatar
    • Adam Langley's avatar
      external/conscrypt: tweaks for next BoringSSL import. · ca6d8d34
      Adam Langley authored
      Upstream BoringSSL has dropped |SSL_ST_BEFORE| (which appears to have been
      unused) and all the |*_LOCK_*| symbols. The latter are replaced with
      |*_up_ref|, with #if's so that it continues to work with OpenSSL.
      
      (cherry picked from commit ba3f063e)
      
      Change-Id: Ib609c83d428b7624e24e3b96c93afc2e482e6a6d
      ca6d8d34
    • Kenny Root's avatar
      Try to get preferred external provider · 9467d22b
      Kenny Root authored
      When using an opaque key, try to honor the system's preferred provider
      which is selected via late binding. If it's not found, try to find the
      first provider that initializes correctly with the given key.
      
      (cherry picked from commit c590a930)
      
      Bug: 21737886
      Change-Id: I17483136aa5c1c5e474109525aefac9facaf7379
      9467d22b
    • Adam Langley's avatar
      Fix ECDSA upcalls from TLS/SSL into JCA. · 9bca53ce
      Adam Langley authored
      When BoringSSL/OpenSSL TLS/SSL stack operates on opaque private keys
      (those that don't expose their key material) it upcalls (via
      Conscrypt's NativeCrypto) into corresponding JCA Signature and Cipher
      primitives.
      
      This fixes a crash in the ECDSA upcall when Conscrypt is used with
      BoringSSL.
      
      (cherry-picked from commit 61c66eb9)
      
      Bug: 21738458
      Change-Id: I6def1bce62f20b2ec39fe88251975458e8813362
      9bca53ce
    • Alex Klyubin's avatar
      Fix RSA upcalls from TLS/SSL into JCA. · d1b4488c
      Alex Klyubin authored
      When BoringSSL/OpenSSL TLS/SSL stack operates on opaque private keys
      (those that don't expose their key material) it upcalls (via
      Conscrypt's NativeCrypto) into corresponding JCA Signature and Cipher
      primitives.
      
      This CL fixes two issues with RSA-related upcalls, which prevented
      the use of opaque RSA private keys for TLS/SSL with Conscrypt backed
      by BoringSSL:
      * RSA sign was upcalled into RSA Cipher decrypt using private key.
        In JCA, the correct upcall is RSA Signature sign. This is now
        invoked instead of RSA Cipher decrypt.
      * RSA decrypt was not implemented. It's now implemented.
      
      As part of implementing RSA decrypt upcall from BoringSSL, it
      transpired that BoringSSL requests no padding as opposed to OpenSSL
      which requests PKCS#1 padding. As a result, this CL modifies the
      decrypt upcall to take a padding parameter. The implementation of
      the upcall (see CryptoUpcalls.java) now supports PKCS#1 padding
      scheme, OAEP padding scheme, and no padding.
      
      This CL also drops the encrypt/decrypt flag from the RSA
      encrypt/decrypt upcall and simplies it into an RSA decrypt upcall. RSA
      encrypt upcall is not needed at all.
      
      (cherry-picked from commit 279e9845)
      
      Bug: 21738458
      Change-Id: I075aa74e4cd89dd3ceab99f728ce371c7bc89cf0
      d1b4488c
  4. 10 Jun, 2015 1 commit
    • Kenny Root's avatar
      NativeCrypto: special case for empty cipher list · d65ea6de
      Kenny Root authored
      For the Java language, setting an empty cipher list is not an error but
      it's an error in OpenSSL. However, the underlying API actually updates
      the cipher list to an empty string as intended. So we need to handle
      this special case by clearing the error stack and making sure that our
      expectation is satisfied.
      
      (cherry picked from commit 5b6a5ecc)
      
      Bug: 21195269
      Change-Id: Id21792215513f4e0d6e051160f69e5f830d39015
      d65ea6de
  5. 04 Jun, 2015 1 commit
  6. 02 Jun, 2015 4 commits
  7. 01 Jun, 2015 3 commits
  8. 29 May, 2015 1 commit
    • Kenny Root's avatar
      NativeCrypto: throw exception on RSA op failure · d5d7063d
      Kenny Root authored
      A -1 error code should have an error on the stack that explains what the
      problem was, but if we call through to an ENGINE that fails we seem to
      end up with no error on the stack. Ensure we throw BadPaddingException
      in that case.
      
      (cherry picked from commit 6a1e7070)
      
      Bug: 19863798
      Change-Id: Idecd9072c1e6636351bc90f16037852bdc55e4a0
      d5d7063d
  9. 28 May, 2015 4 commits
    • Kenny Root's avatar
      OpenSSLX509Certificate: mark mContext as transient · de55e62f
      Kenny Root authored
      Since mContext should not participate in the serialization process,
      hide it with the transient qualifier. This will prevent the field from
      initialization during the unserialization of this class. Then of course
      the instance will be in a valid state.
      
      (cherry picked from commit 8d57b9db)
      
      Bug: 21437603
      Change-Id: Ie9453c16d11820a91caff92c3f7b326d12f8a8f4
      de55e62f
    • Kenny Root's avatar
      OpenSSLX509Certificate: mark mContext as transient · 8d57b9db
      Kenny Root authored
      Since mContext should not participate in the serialization process,
      hide it with the transient qualifier. This will prevent the field from
      initialization during the unserialization of this class. Then of course
      the instance will be in a valid state.
      
      Bug: 21437603
      Change-Id: Id5b8a83b6000c2219f3246f93aff7a9c6453f639
      8d57b9db
    • Kenny Root's avatar
      Revert "OpenSSLX509Certificate: mark mContext as transient" · 42b8c5e4
      Kenny Root authored
      This reverts commit 998fbfcd. Missing the test class.
      
      Change-Id: I426680f74c4f3ebeb42abd80ebfdba469247c348
      42b8c5e4
    • Kenny Root's avatar
      OpenSSLX509Certificate: mark mContext as transient · 998fbfcd
      Kenny Root authored
      Since mContext should not participate in the serialization process,
      hide it with the transient qualifier. This will prevent the field from
      initialization during the unserialization of this class. Then of course
      the instance will be in a valid state.
      
      Bug: 21437603
      Change-Id: Ie9453c16d11820a91caff92c3f7b326d12f8a8f4
      998fbfcd
  10. 22 May, 2015 2 commits
    • Adam Langley's avatar
      Use |BIO_read_asn1| when parsing PKCS#7. · 86733983
      Adam Langley authored
      Previously the code read the whole of the BIO and parsed any PKCS#7
      blobs that were found. However, X509CertificateTest specifically tests
      that trailing data is retained when parsing PKCS#7 so this change makes
      it so.
      
      This depends on https://android-review.googlesource.com/#/c/151205/.
      
      (cherry picked from commit 0f84dc61)
      
      Bug: 21396526
      Bug: 21209493
      Change-Id: I4e07cebf599f52aedbea9b0a3f66d9a052c86aaa
      86733983
    • Adam Langley's avatar
      Add isFinite flag to OpenSSLBIOInputStream. · d82dc06f
      Adam Langley authored
      The BIO created by OpenSSLBIOInputStream currently returns -1 and sets
      the retry flag when read() returns zero on the underlying InputStream.
      This is correct for “infinite” streams (like a socket), but isn't
      correct for streams that have a definitive EOF.
      
      This change adds a flag to OpenSSLBIOInputStream so that cases where the
      input is finite (i.e. when parsing a PKCS#7 or X.509 block) can
      correctly return 0 at EOF from |BIO_read|.
      
      (cherry picked from commit 66537ee0)
      
      Bug: 21396526
      Bug: 21209493
      Change-Id: Iaad5845621ab8b89b42d5d3ca8e67e297278ca55
      d82dc06f
  11. 20 May, 2015 1 commit
    • Kenny Root's avatar
      SSL: select the right key type for kx · 959e25c3
      Kenny Root authored
      During the switch to BoringSSL this function was rewritten and it
      requested DH public key with RSA signature for a lot of things.
      
      (cherry picked from commit d8606d56)
      
      Bug: 20641394
      Change-Id: Id3880b01ed1810c5d7af9996c48ce45fdf4850f8
      959e25c3
  12. 15 May, 2015 1 commit
    • Kenny Root's avatar
      Move BoringSSL indication to NativeConstants · 732e4009
      Kenny Root authored
      Toucing NativeCrypto causes System.loadLibrary(...) to be called which
      causes classloader initialization to fail during compile time. To allow
      more to be initialized, move this to NativeConstants.
      
      (cherry picked from commit f5b4518e)
      
      Bug: 21036900
      Change-Id: I07f0f5be9559a9fa9a652d1bcd82a9f88640653e
      732e4009
  13. 13 May, 2015 4 commits