1. 25 5月, 2020 1 次提交
    • N
      Fix coverity issues in EC after #11807 · 9c47a338
      Nicola Tuveri 提交于
      This should fix 2 issues detected by Coverity and introduced with
      https://github.com/openssl/openssl/pull/11807
      
      - CID 1463577:  Memory - corruptions  (ARRAY_VS_SINGLETON)
      - CID 1463573:  Memory - corruptions  (ARRAY_VS_SINGLETON)
      
      In practice the tests seem to show that they both aren't real issues,
      yet I believe this small change should appease the scanner and at the
      same time improve clarity for the reader.
      
      Here is the original report:
      
      ```
      ** CID 1463577:  Memory - corruptions  (ARRAY_VS_SINGLETON)
      
      ________________________________________________________________________________________________________
      *** CID 1463577:  Memory - corruptions  (ARRAY_VS_SINGLETON)
      /crypto/ec/ec_lib.c: 1123 in EC_POINT_mul()
      1117
      1118         if (group->meth->mul != NULL)
      1119             ret = group->meth->mul(group, r, g_scalar, point != NULL
      1120                                    && p_scalar != NULL, &point, &p_scalar, ctx);
      1121         else
      1122             /* use default */
         CID 1463577:  Memory - corruptions  (ARRAY_VS_SINGLETON)
         Passing "&point" to function "ec_wNAF_mul" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.
      1123             ret = ec_wNAF_mul(group, r, g_scalar, point != NULL
      1124                               && p_scalar != NULL, &point, &p_scalar, ctx);
      1125
      1126     #ifndef FIPS_MODULE
      1127         BN_CTX_free(new_ctx);
      1128     #endif
      
      ** CID 1463573:  Memory - corruptions  (ARRAY_VS_SINGLETON)
      
      ________________________________________________________________________________________________________
      *** CID 1463573:  Memory - corruptions  (ARRAY_VS_SINGLETON)
      /crypto/ec/ec_lib.c: 1123 in EC_POINT_mul()
      1117
      1118         if (group->meth->mul != NULL)
      1119             ret = group->meth->mul(group, r, g_scalar, point != NULL
      1120                                    && p_scalar != NULL, &point, &p_scalar, ctx);
      1121         else
      1122             /* use default */
         CID 1463573:  Memory - corruptions  (ARRAY_VS_SINGLETON)
         Passing "&p_scalar" to function "ec_wNAF_mul" which uses it as an array. This might corrupt or misinterpret adjacent memory locations.
      1123             ret = ec_wNAF_mul(group, r, g_scalar, point != NULL
      1124                               && p_scalar != NULL, &point, &p_scalar, ctx);
      1125
      1126     #ifndef FIPS_MODULE
      1127         BN_CTX_free(new_ctx);
      1128     #endif
      ```
      Reviewed-by: NKurt Roeckx <kurt@roeckx.be>
      Reviewed-by: NPaul Dale <paul.dale@oracle.com>
      (Merged from https://github.com/openssl/openssl/pull/11919)
      9c47a338
  2. 24 5月, 2020 3 次提交
  3. 23 5月, 2020 1 次提交
  4. 22 5月, 2020 6 次提交
  5. 21 5月, 2020 5 次提交
  6. 20 5月, 2020 9 次提交
  7. 19 5月, 2020 12 次提交
  8. 18 5月, 2020 3 次提交