提交 32ee4524 编写于 作者: P Pauli

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: NTomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: NDmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/9207)
上级 2d905f67
......@@ -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,
......
/*
* 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;
}
......
......@@ -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)
{
......
......@@ -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>
......
/*
* 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
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册