1. 03 May, 2015 1 commit
  2. 02 May, 2015 8 commits
  3. 01 May, 2015 10 commits
  4. 30 Apr, 2015 18 commits
    • Matt Caswell's avatar
      Fix buffer overrun in RSA signing · 34166d41
      Matt Caswell authored
      
      
      The problem occurs in EVP_PKEY_sign() when using RSA with X931 padding.
      It is only triggered if the RSA key size is smaller than the digest length.
      So with SHA512 you can trigger the overflow with anything less than an RSA
      512 bit key. I managed to trigger a 62 byte overflow when using a 16 bit RSA
      key. This wasn't sufficient to cause a crash, although your mileage may
      vary.
      
      In practice RSA keys of this length are never used and X931 padding is very
      rare. Even if someone did use an excessively short RSA key, the chances of
      them combining that with a longer digest and X931 padding is very
      small. For these reasons I do not believe there is a security implication to
      this. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3
      Solutions) for reporting this issue.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      34166d41
    • Matt Caswell's avatar
      Add sanity check to print_bin function · 3deeeeb6
      Matt Caswell authored
      
      
      Add a sanity check to the print_bin function to ensure that the |off|
      argument is positive. Thanks to Kevin Wojtysiak (Int3 Solutions) and
      Paramjot Oberoi (Int3 Solutions) for reporting this issue.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      3deeeeb6
    • Matt Caswell's avatar
      Add sanity check to ssl_get_prev_session · cb0f400b
      Matt Caswell authored
      
      
      Sanity check the |len| parameter to ensure it is positive. Thanks to Kevin
      Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for
      reporting this issue.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      cb0f400b
    • Matt Caswell's avatar
      Sanity check the return from final_finish_mac · c427570e
      Matt Caswell authored
      
      
      The return value is checked for 0. This is currently safe but we should
      really check for <= 0 since -1 is frequently used for error conditions.
      Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3
      Solutions) for reporting this issue.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      c427570e
    • Matt Caswell's avatar
      Add sanity check in ssl3_cbc_digest_record · 29b0a15a
      Matt Caswell authored
      
      
      For SSLv3 the code assumes that |header_length| > |md_block_size|. Whilst
      this is true for all SSLv3 ciphersuites, this fact is far from obvious by
      looking at the code. If this were not the case then an integer overflow
      would occur, leading to a subsequent buffer overflow. Therefore I have
      added an explicit sanity check to ensure header_length is always valid.
      Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3
      Solutions) for reporting this issue.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      29b0a15a
    • Matt Caswell's avatar
      Clarify logic in BIO_*printf functions · 9d9e3774
      Matt Caswell authored
      
      
      The static function dynamically allocates an output buffer if the output
      grows larger than the static buffer that is normally used. The original
      logic implied that |currlen| could be greater than |maxlen| which is
      incorrect (and if so would cause a buffer overrun). Also the original
      logic would call OPENSSL_malloc to create a dynamic buffer equal to the
      size of the static buffer, and then immediately call OPENSSL_realloc to
      make it bigger, rather than just creating a buffer than was big enough in
      the first place. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot
      Oberoi (Int3 Solutions) for reporting this issue.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      9d9e3774
    • Matt Caswell's avatar
      Sanity check EVP_EncodeUpdate buffer len · b86d7dca
      Matt Caswell authored
      
      
      There was already a sanity check to ensure the passed buffer length is not
      zero. Extend this to ensure that it also not negative. Thanks to Kevin
      Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for
      reporting this issue.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      b86d7dca
    • Matt Caswell's avatar
      Sanity check EVP_CTRL_AEAD_TLS_AAD · c8269881
      Matt Caswell authored
      
      
      The various implementations of EVP_CTRL_AEAD_TLS_AAD expect a buffer of at
      least 13 bytes long. Add sanity checks to ensure that the length is at
      least that. Also add a new constant (EVP_AEAD_TLS1_AAD_LEN) to evp.h to
      represent this length. Thanks to Kevin Wojtysiak (Int3 Solutions) and
      Paramjot Oberoi (Int3 Solutions) for reporting this issue.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      c8269881
    • Matt Caswell's avatar
      Sanity check DES_enc_write buffer length · 873fb39f
      Matt Caswell authored
      
      
      Add a sanity check to DES_enc_write to ensure the buffer length provided
      is not negative. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot
      Oberoi (Int3 Solutions) for reporting this issue.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      873fb39f
    • Rich Salz's avatar
      free cleanup 12 · 895cba19
      Rich Salz authored
      
      
      Don't check for NULL before calling free function.  This gets:
              NAME_CONSTRAINTS_free GENERAL_SUBTREE_free ECDSA_METHOD_free
              JPAKE_CTX_free OCSP_REQ_CTX_free SCT_free SRP_VBASE_free
              SRP_gN_free SRP_user_pwd_free TXT_DB_free
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      895cba19
    • Matt Caswell's avatar
      make update · b0696f8b
      Matt Caswell authored
      
      
      Run make update following previous header file changes.
      
      Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
      b0696f8b
    • Rich Salz's avatar
      free cleanup almost the finale · 4b45c6e5
      Rich Salz authored
      
      
      Add OPENSSL_clear_free which merges cleanse and free.
      (Names was picked to be similar to BN_clear_free, etc.)
      Removed OPENSSL_freeFunc macro.
      Fixed the small simple ones that are left:
              CRYPTO_free CRYPTO_free_locked OPENSSL_free_locked
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      4b45c6e5
    • Rich Salz's avatar
      In apps, malloc or die · 68dc6824
      Rich Salz authored
      
      
      No point in proceeding if you're out of memory.  So change
      *all* OPENSSL_malloc calls in apps to use the new routine which
      prints a message and exits.
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      68dc6824
    • Rich Salz's avatar
      free NULL cleanup 5a · 222561fe
      Rich Salz authored
      
      
      Don't check for NULL before calling a free routine.  This gets X509_.*free:
          x509_name_ex_free X509_policy_tree_free X509_VERIFY_PARAM_free
          X509_STORE_free X509_STORE_CTX_free X509_PKEY_free
          X509_OBJECT_free_contents X509_LOOKUP_free X509_INFO_free
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      222561fe
    • Rich Salz's avatar
      free NULL cleanup 8 · 2ace7450
      Rich Salz authored
      
      
      Do not check for NULL before calling a free routine.  This addresses:
          ASN1_BIT_STRING_free ASN1_GENERALIZEDTIME_free ASN1_INTEGER_free
          ASN1_OBJECT_free ASN1_OCTET_STRING_free ASN1_PCTX_free ASN1_SCTX_free
          ASN1_STRING_clear_free ASN1_STRING_free ASN1_TYPE_free
          ASN1_UTCTIME_free M_ASN1_free_of
      
      Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
      2ace7450
    • Rich Salz's avatar
      Fix bug, "what mode" test was wrong. · 5a80d9fb
      Rich Salz authored
      
      
      Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
      5a80d9fb
    • Matt Caswell's avatar
      Fix windows build · a3ed492f
      Matt Caswell authored
      
      
      The big apps cleanup broke the windows build. This commit
      fixes some miscellaneous issues so that it builds again.
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      a3ed492f
    • Matt Caswell's avatar
      Remove redundant includes from dtls1.h · fb456902
      Matt Caswell authored
      
      
      There were a set of includes in dtls1.h which are now redundant due to the
      libssl opaque work. This commit removes those includes, which also has the
      effect of resolving one issue preventing building on windows (i.e. the
      include of winsock.h)
      
      Reviewed-by: default avatarAndy Polyakov <appro@openssl.org>
      fb456902
  5. 29 Apr, 2015 3 commits