[openssl] master update

Dr. Paul Dale pauli at openssl.org
Fri Jun 21 06:44:59 UTC 2019


The branch master has been updated
       via  32ee452496f8cf4558d645f9db908b09df919f04 (commit)
      from  2d905f6715453034d1f942a0237b0d2b9d57326c (commit)


- Log -----------------------------------------------------------------
commit 32ee452496f8cf4558d645f9db908b09df919f04
Author: Pauli <paul.dale at oracle.com>
Date:   Fri Jun 21 09:27:48 2019 +1000

    Remove OPENSSL_memcmp.
    
    After avoiding OPENSSL_memcmp for EC curve comparison, there are no remaining
    uses in the source code.  The function is only defined in an internal header
    and thus should be safe to remove for 3.0.0.
    
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    Reviewed-by: Dmitry Belyavskiy <beldmit at gmail.com>
    (Merged from https://github.com/openssl/openssl/pull/9207)

-----------------------------------------------------------------------

Summary of changes:
 Configurations/unix-Makefile.tmpl |  1 -
 crypto/ec/ec_curve.c              |  9 ++++-----
 crypto/o_str.c                    | 12 ------------
 crypto/x509/v3_tlsf.c             |  1 -
 include/internal/o_str.h          | 17 -----------------
 util/libcrypto.num                |  2 +-
 util/missingcrypto.txt            |  1 -
 7 files changed, 5 insertions(+), 38 deletions(-)
 delete mode 100644 include/internal/o_str.h

diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index ce93a4e..52eeaa9 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -804,7 +804,6 @@ errors:
    our @cryptoheaders =
        qw( include/internal/dso.h
            include/internal/o_dir.h
-           include/internal/o_str.h
            include/internal/err.h
            include/internal/sslconf.h );
    our @cryptoskipheaders = ( @sslheaders,
diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c
index 6c7c9dd..1ea8594 100644
--- a/crypto/ec/ec_curve.c
+++ b/crypto/ec/ec_curve.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -14,7 +14,6 @@
 #include <openssl/obj_mac.h>
 #include <openssl/opensslconf.h>
 #include "internal/nelem.h"
-#include "internal/o_str.h"
 
 typedef struct {
     int field_type,             /* either NID_X9_62_prime_field or
@@ -3302,10 +3301,10 @@ int ec_curve_nid_from_params(const EC_GROUP *group)
             /* Check the optional seed (ignore if its not set) */
             && (data->seed_len == 0 || seed_len == 0
                 || ((size_t)data->seed_len == seed_len
-                     && OPENSSL_memcmp(params_seed, seed, seed_len) == 0))
+                     && memcmp(params_seed, seed, seed_len) == 0))
             /* Check that the groups params match the built-in curve params */
-            && OPENSSL_memcmp(param_bytes, params, param_len * NUM_BN_FIELDS)
-                              == 0) {
+            && memcmp(param_bytes, params, param_len * NUM_BN_FIELDS)
+                             == 0) {
             ret = curve.nid;
             goto end;
         }
diff --git a/crypto/o_str.c b/crypto/o_str.c
index 0403982..467ceb2 100644
--- a/crypto/o_str.c
+++ b/crypto/o_str.c
@@ -11,18 +11,6 @@
 #include <limits.h>
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
-#include "internal/o_str.h"
-
-int OPENSSL_memcmp(const void *v1, const void *v2, size_t n)
-{
-    const unsigned char *c1 = v1, *c2 = v2;
-    int ret = 0;
-
-    while (n && (ret = *c1 - *c2) == 0)
-        n--, c1++, c2++;
-
-    return ret;
-}
 
 char *CRYPTO_strdup(const char *str, const char* file, int line)
 {
diff --git a/crypto/x509/v3_tlsf.c b/crypto/x509/v3_tlsf.c
index d3ab3f8..28e83bb 100644
--- a/crypto/x509/v3_tlsf.c
+++ b/crypto/x509/v3_tlsf.c
@@ -10,7 +10,6 @@
 #include "e_os.h"
 #include "internal/cryptlib.h"
 #include <stdio.h>
-#include "internal/o_str.h"
 #include <openssl/asn1t.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
diff --git a/include/internal/o_str.h b/include/internal/o_str.h
deleted file mode 100644
index dc236ca..0000000
--- a/include/internal/o_str.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2003-2016 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef HEADER_O_STR_H
-# define HEADER_O_STR_H
-
-# include <stddef.h>            /* to get size_t */
-
-int OPENSSL_memcmp(const void *p1, const void *p2, size_t n);
-
-#endif
diff --git a/util/libcrypto.num b/util/libcrypto.num
index 0b18107..af6e2b9 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -462,7 +462,7 @@ X509v3_asid_add_id_or_range             462	3_0_0	EXIST::FUNCTION:RFC3779
 X509_NAME_ENTRY_create_by_NID           463	3_0_0	EXIST::FUNCTION:
 EC_KEY_METHOD_get_init                  464	3_0_0	EXIST::FUNCTION:EC
 ASN1_INTEGER_to_BN                      465	3_0_0	EXIST::FUNCTION:
-OPENSSL_memcmp                          466	3_0_0	EXIST::FUNCTION:
+OPENSSL_memcmp                          466	3_0_0	NOEXIST::FUNCTION:
 BUF_MEM_new                             467	3_0_0	EXIST::FUNCTION:
 DSO_set_filename                        468	3_0_0	EXIST::FUNCTION:
 DH_new                                  469	3_0_0	EXIST::FUNCTION:DH
diff --git a/util/missingcrypto.txt b/util/missingcrypto.txt
index e68ddc8..30b1e2d 100644
--- a/util/missingcrypto.txt
+++ b/util/missingcrypto.txt
@@ -729,7 +729,6 @@ OPENSSL_gmtime_diff
 OPENSSL_init
 OPENSSL_isservice
 OPENSSL_issetugid
-OPENSSL_memcmp
 OPENSSL_sk_deep_copy
 OPENSSL_sk_delete
 OPENSSL_sk_delete_ptr


More information about the openssl-commits mailing list