提交 b0700d2c 编写于 作者: R Rich Salz 提交者: Rich Salz

Replace "SSLeay" in API with OpenSSL

All instances of SSLeay (any combination of case) were replaced with
the case-equivalent OpenSSL.
Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 87d9cafa
......@@ -14,6 +14,10 @@
also been removed.
[Matt Caswell]
*) All instances of the string "ssleay" in the public API were replaced
with OpenSSL (case-matching; e.g., OPENSSL_VERSION for #define's)
[Rich Salz]
*) The demo files in crypto/threads were moved to demo/threads.
[Rich Salz]
......
......@@ -10,29 +10,14 @@ $! At the end of that grab newreq.pem and newcert.pem (one has the key
$! and the other the certificate) and cat them together and that is what
$! you want/need ... I'll make even this a little cleaner later.
$!
$!
$! 12-Jan-96 tjh Added more things ... including CA -signcert which
$! converts a certificate to a request and then signs it.
$! 10-Jan-96 eay Fixed a few more bugs and added the SSLEAY_CONFIG
$! environment variable so this can be driven from
$! a script.
$! 25-Jul-96 eay Cleaned up filenames some more.
$! 11-Jun-96 eay Fixed a few filename missmatches.
$! 03-May-96 eay Modified to use 'openssl cmd' instead of 'cmd'.
$! 18-Apr-96 tjh Original hacking
$!
$! Tim Hudson
$! tjh@cryptsoft.com
$!
$!
$! default ssleay.cnf file has setup as per the following
$! default openssl.cnf file has setup as per the following
$! demoCA ... where everything is stored
$
$ IF F$TYPE(SSLEAY_CONFIG) .EQS. "" THEN SSLEAY_CONFIG := SSLLIB:SSLEAY.CNF
$ IF F$TYPE(OPENSSL_CONFIG) .EQS. "" THEN OPENSSL_CONFIG := SSLLIB:OPENSSL.CNF
$
$ DAYS = "-days 365"
$ REQ = openssl + " req " + SSLEAY_CONFIG
$ CA = openssl + " ca " + SSLEAY_CONFIG
$ REQ = openssl + " req " + OPENSSL_CONFIG
$ CA = openssl + " ca " + OPENSSL_CONFIG
$ VERIFY = openssl + " verify"
$ X509 = openssl + " x509"
$ PKCS12 = openssl + " pkcs12"
......
......@@ -16,11 +16,11 @@ if(defined $ENV{'OPENSSL'}) {
my $verbose = 1;
my $SSLEAY_CONFIG = $ENV{"SSLEAY_CONFIG"};
my $OPENSSL_CONFIG = $ENV{"OPENSSL_CONFIG"};
my $DAYS = "-days 365";
my $CADAYS = "-days 1095"; # 3 years
my $REQ = "$openssl req $SSLEAY_CONFIG";
my $CA = "$openssl ca $SSLEAY_CONFIG";
my $REQ = "$openssl req $OPENSSL_CONFIG";
my $CA = "$openssl ca $OPENSSL_CONFIG";
my $VERIFY = "$openssl verify";
my $X509 = "$openssl x509";
my $PKCS12 = "$openssl pkcs12";
......
......@@ -217,8 +217,7 @@ static char *make_config_name()
size_t len;
char *p;
if ((t = getenv("OPENSSL_CONF")) != NULL
|| (t = getenv("SSLEAY_CONF")) != NULL)
if ((t = getenv("OPENSSL_CONF")) != NULL)
return BUF_strdup(t);
t = X509_get_default_cert_area();
......
......@@ -2719,7 +2719,7 @@ static int www_body(char *hostname, int s, int stype, unsigned char *context)
"HTTP/1.0 200 ok\r\nContent-type: text/html\r\n\r\n");
BIO_puts(io, "<HTML><BODY BGCOLOR=\"#ffffff\">\n");
BIO_puts(io, "<pre>\n");
/* BIO_puts(io,SSLeay_version(SSLEAY_VERSION));*/
/* BIO_puts(io,OpenSSL_version(OPENSSL_VERSION));*/
BIO_puts(io, "\n");
for (i = 0; i < local_argc; i++) {
const char *myp;
......
......@@ -869,7 +869,7 @@ int speed_main(int argc, char **argv)
#ifndef OPENSSL_NO_RSA
# ifndef RSA_NULL
if (strcmp(*argv, "openssl") == 0) {
RSA_set_default_method(RSA_PKCS1_SSLeay());
RSA_set_default_method(RSA_PKCS1_OpenSSL());
continue;
}
# endif
......@@ -2041,8 +2041,8 @@ int speed_main(int argc, char **argv)
show_res:
#endif
if (!mr) {
printf("%s\n", SSLeay_version(SSLEAY_VERSION));
printf("%s\n", SSLeay_version(SSLEAY_BUILT_ON));
printf("%s\n", OpenSSL_version(OPENSSL_VERSION));
printf("%s\n", OpenSSL_version(OPENSSL_BUILT_ON));
printf("options:");
printf("%s ", BN_options());
#ifndef OPENSSL_NO_MD2
......@@ -2063,7 +2063,7 @@ int speed_main(int argc, char **argv)
#ifndef OPENSSL_NO_BF
printf("%s ", BF_options());
#endif
printf("\n%s\n", SSLeay_version(SSLEAY_CFLAGS));
printf("\n%s\n", OpenSSL_version(OPENSSL_CFLAGS));
}
if (pr_header) {
......
......@@ -193,17 +193,17 @@ int version_main(int argc, char **argv)
version = 1;
if (version) {
if (SSLeay() == SSLEAY_VERSION_NUMBER) {
printf("%s\n", SSLeay_version(SSLEAY_VERSION));
if (OpenSSL_version_num() == OPENSSL_VERSION_NUMBER) {
printf("%s\n", OpenSSL_version(OPENSSL_VERSION));
} else {
printf("%s (Library: %s)\n",
OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION));
}
}
if (date)
printf("%s\n", SSLeay_version(SSLEAY_BUILT_ON));
printf("%s\n", OpenSSL_version(OPENSSL_BUILT_ON));
if (platform)
printf("%s\n", SSLeay_version(SSLEAY_PLATFORM));
printf("%s\n", OpenSSL_version(OPENSSL_PLATFORM));
if (options) {
printf("options: ");
printf("%s ", BN_options());
......@@ -225,9 +225,9 @@ int version_main(int argc, char **argv)
printf("\n");
}
if (cflags)
printf("%s\n", SSLeay_version(SSLEAY_CFLAGS));
printf("%s\n", OpenSSL_version(OPENSSL_CFLAGS));
if (dir)
printf("%s\n", SSLeay_version(SSLEAY_DIR));
printf("%s\n", OpenSSL_version(OPENSSL_DIR));
ret = 0;
end:
return (ret);
......
......@@ -292,23 +292,11 @@ struct bn_gencb_st {
* (with draws in between). Very small exponents are often selected
* with low Hamming weight, so we use w = 1 for b <= 23.
*/
# if 1
# define BN_window_bits_for_exponent_size(b) \
# define BN_window_bits_for_exponent_size(b) \
((b) > 671 ? 6 : \
(b) > 239 ? 5 : \
(b) > 79 ? 4 : \
(b) > 23 ? 3 : 1)
# else
/*
* Old SSLeay/OpenSSL table. Maximum window size was 5, so this table differs
* for b==1024; but it coincides for other interesting values (b==160,
* b==512).
*/
# define BN_window_bits_for_exponent_size(b) \
((b) > 255 ? 5 : \
(b) > 127 ? 4 : \
(b) > 17 ? 3 : 1)
# endif
/*
* BN_mod_exp_mont_conttime is based on the assumption that the L1 data cache
......
此差异已折叠。
......@@ -18,17 +18,6 @@ loop: while ($#primes < $num-1)
push(@primes,$p);
}
# print <<"EOF";
# /* Auto generated by bn_prime.pl */
# /* Copyright (C) 1995-1997 Eric Young (eay\@mincom.oz.au).
# * All rights reserved.
# * Copyright remains Eric Young's, and as such any Copyright notices in
# * the code are not to be removed.
# * See the COPYRIGHT file in the SSLeay distribution for more details.
# */
#
# EOF
print <<\EOF;
/* Auto generated by bn_prime.pl */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
......@@ -37,21 +26,21 @@ print <<\EOF;
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
......@@ -66,10 +55,10 @@ print <<\EOF;
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
......@@ -81,7 +70,7 @@ print <<\EOF;
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
......@@ -100,20 +89,18 @@ for ($i=0; $i <= $#primes; $i++)
}
printf "#ifndef EIGHT_BIT\n";
printf "#define NUMPRIMES %d\n",$num;
printf "# define NUMPRIMES %d\n",$num;
printf "typedef unsigned short prime_t;\n";
printf "#else\n";
printf "#define NUMPRIMES %d\n",$eight;
printf "# define NUMPRIMES %d\n",$eight;
printf "typedef unsigned char prime_t;\n";
printf "#endif\n";
print "static const prime_t primes[NUMPRIMES]=\n\t{\n\t";
print "static const prime_t primes[NUMPRIMES]= {\n ";
$init=0;
for ($i=0; $i <= $#primes; $i++)
{
printf "\n#ifndef EIGHT_BIT\n\t" if ($primes[$i] > 256) && !($init++);
printf("\n\t") if (($i%8) == 0) && ($i != 0);
printf("%4d,",$primes[$i]);
printf "\n#ifndef EIGHT_BIT\n " if ($primes[$i] > 256) && !($init++);
printf "\n " if (($i%8) == 0) && ($i != 0);
printf "%4d, ", $primes[$i];
}
print "\n#endif\n\t};\n";
print "\n#endif\n};\n";
......@@ -62,11 +62,16 @@
# include "buildinf.h"
#endif
const char *SSLeay_version(int t)
unsigned long OpenSSL_version_num()
{
if (t == SSLEAY_VERSION)
return OPENSSL_VERSION_NUMBER;
}
const char *OpenSSL_version(int t)
{
if (t == OPENSSL_VERSION)
return OPENSSL_VERSION_TEXT;
if (t == SSLEAY_BUILT_ON) {
if (t == OPENSSL_BUILT_ON) {
#ifdef DATE
# ifdef OPENSSL_USE_BUILD_DATE
return (DATE);
......@@ -77,21 +82,21 @@ const char *SSLeay_version(int t)
return ("built on: date not available");
#endif
}
if (t == SSLEAY_CFLAGS) {
if (t == OPENSSL_CFLAGS) {
#ifdef CFLAGS
return (CFLAGS);
#else
return ("compiler: information not available");
#endif
}
if (t == SSLEAY_PLATFORM) {
if (t == OPENSSL_PLATFORM) {
#ifdef PLATFORM
return (PLATFORM);
#else
return ("platform: information not available");
#endif
}
if (t == SSLEAY_DIR) {
if (t == OPENSSL_DIR) {
#ifdef OPENSSLDIR
return "OPENSSLDIR: \"" OPENSSLDIR "\"";
#else
......@@ -100,8 +105,3 @@ const char *SSLeay_version(int t)
}
return ("not available");
}
unsigned long SSLeay(void)
{
return (SSLEAY_VERSION_NUMBER);
}
......@@ -114,7 +114,7 @@ ecb_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
ecb_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ecb_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
ecb_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecb_enc.o: des_locl.h des_ver.h ecb_enc.c
ecb_enc.o: des_locl.h ecb_enc.c
enc_read.o: ../../e_os.h ../../include/openssl/bio.h
enc_read.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
enc_read.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
......@@ -161,8 +161,7 @@ read2pwd.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
read2pwd.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
read2pwd.o: read2pwd.c
rpc_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
rpc_enc.o: ../../include/openssl/opensslconf.h des_locl.h des_ver.h rpc_des.h
rpc_enc.o: rpc_enc.c
rpc_enc.o: ../../include/openssl/opensslconf.h des_locl.h rpc_des.h rpc_enc.c
set_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
set_key.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
set_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
......
/* crypto/des/des_ver.h */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include <openssl/e_os2.h>
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
# undef OPENSSL_EXTERN
# define OPENSSL_EXTERN OPENSSL_EXPORT
#endif
/* The following macros make sure the names are different from libdes names */
#define DES_version OSSL_DES_version
#define libdes_version OSSL_libdes_version
/* SSLeay version string */
OPENSSL_EXTERN const char OSSL_DES_version[];
/* old libdes version string */
OPENSSL_EXTERN const char OSSL_libdes_version[];
......@@ -57,7 +57,6 @@
*/
#include "des_locl.h"
#include "des_ver.h"
#include <openssl/opensslv.h>
#include <openssl/bio.h>
......
......@@ -58,7 +58,6 @@
#include "rpc_des.h"
#include "des_locl.h"
#include "des_ver.h"
int _des_crypt(char *buf, int len, struct desparams *desp);
int _des_crypt(char *buf, int len, struct desparams *desp)
......
......@@ -1129,12 +1129,12 @@ cryptodev_bn_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
kop.crk_iparams = 3;
if (cryptodev_asym(&kop, BN_num_bytes(m), r, 0, NULL)) {
const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
const RSA_METHOD *meth = RSA_PKCS1_OpenSSL();
printf("OCF asym process failed, Running in software\n");
ret = meth->bn_mod_exp(r, a, p, m, ctx, in_mont);
} else if (ECANCELED == kop.crk_status) {
const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
const RSA_METHOD *meth = RSA_PKCS1_OpenSSL();
printf("OCF hardware operation cancelled. Running in Software\n");
ret = meth->bn_mod_exp(r, a, p, m, ctx, in_mont);
}
......@@ -1185,12 +1185,12 @@ cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
kop.crk_iparams = 6;
if (cryptodev_asym(&kop, BN_num_bytes(rsa->n), r0, 0, NULL)) {
const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
const RSA_METHOD *meth = RSA_PKCS1_OpenSSL();
printf("OCF asym process failed, running in Software\n");
ret = (*meth->rsa_mod_exp) (r0, I, rsa, ctx);
} else if (ECANCELED == kop.crk_status) {
const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
const RSA_METHOD *meth = RSA_PKCS1_OpenSSL();
printf("OCF hardware operation cancelled. Running in Software\n");
ret = (*meth->rsa_mod_exp) (r0, I, rsa, ctx);
}
......@@ -1477,7 +1477,7 @@ void ENGINE_load_cryptodev(void)
}
if (ENGINE_set_RSA(engine, &cryptodev_rsa)) {
const RSA_METHOD *rsa_meth = RSA_PKCS1_SSLeay();
const RSA_METHOD *rsa_meth = RSA_PKCS1_OpenSSL();
cryptodev_rsa.bn_mod_exp = rsa_meth->bn_mod_exp;
cryptodev_rsa.rsa_mod_exp = rsa_meth->rsa_mod_exp;
......
......@@ -158,7 +158,7 @@ static int bind_helper(ENGINE *e)
# ifndef OPENSSL_NO_DH
|| !ENGINE_set_DH(e, DH_get_default_method())
# endif
|| !ENGINE_set_RAND(e, RAND_SSLeay())
|| !ENGINE_set_RAND(e, RAND_OpenSSL())
# ifdef TEST_ENG_OPENSSL_RC4
|| !ENGINE_set_ciphers(e, openssl_ciphers)
# endif
......
......@@ -60,7 +60,7 @@
#include <string.h>
#include <stdlib.h>
/*
* If you wish to build this outside of SSLeay, remove the following lines
* If you wish to build this outside of OpenSSL, remove the following lines
* and things should work as expected
*/
#include "internal/cryptlib.h"
......
......@@ -118,7 +118,7 @@
#include <openssl/safestack.h>
#if defined(OPENSSL_SYS_WIN32)
static double SSLeay_MSVC5_hack = 0.0; /* and for VC1.5 */
static double OpenSSL_MSVC5_hack = 0.0; /* and for VC1.5 */
#endif
DECLARE_STACK_OF(CRYPTO_dynlock)
......@@ -207,7 +207,7 @@ int CRYPTO_get_new_lockid(char *name)
* using /MT. Without this, the application cannot use any floating point
* printf's. It also seems to be needed for Visual C 1.5 (win16)
*/
SSLeay_MSVC5_hack = (double)name[0] * (double)name[1];
OpenSSL_MSVC5_hack = (double)name[0] * (double)name[1];
#endif
if ((app_locks == NULL)
......
......@@ -166,35 +166,35 @@ int rand_predictable = 0;
static void rand_hw_seed(EVP_MD_CTX *ctx);
static void ssleay_rand_cleanup(void);
static int ssleay_rand_seed(const void *buf, int num);
static int ssleay_rand_add(const void *buf, int num, double add_entropy);
static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo);
static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num);
static void rand_cleanup(void);
static int rand_seed(const void *buf, int num);
static int rand_add(const void *buf, int num, double add_entropy);
static int rand_bytes(unsigned char *buf, int num, int pseudo);
static int rand_nopseudo_bytes(unsigned char *buf, int num);
#ifndef OPENSSL_NO_DEPRECATED
static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num);
static int rand_pseudo_bytes(unsigned char *buf, int num);
#endif
static int ssleay_rand_status(void);
static int rand_status(void);
static RAND_METHOD rand_ssleay_meth = {
ssleay_rand_seed,
ssleay_rand_nopseudo_bytes,
ssleay_rand_cleanup,
ssleay_rand_add,
static RAND_METHOD rand_meth = {
rand_seed,
rand_nopseudo_bytes,
rand_cleanup,
rand_add,
#ifndef OPENSSL_NO_DEPRECATED
ssleay_rand_pseudo_bytes,
rand_pseudo_bytes,
#else
NULL,
#endif
ssleay_rand_status
rand_status
};
RAND_METHOD *RAND_SSLeay(void)
RAND_METHOD *RAND_OpenSSL(void)
{
return (&rand_ssleay_meth);
return (&rand_meth);
}
static void ssleay_rand_cleanup(void)
static void rand_cleanup(void)
{
OPENSSL_cleanse(state, sizeof(state));
state_num = 0;
......@@ -206,7 +206,7 @@ static void ssleay_rand_cleanup(void)
initialized = 0;
}
static int ssleay_rand_add(const void *buf, int num, double add)
static int rand_add(const void *buf, int num, double add)
{
int i, j, k, st_idx;
long md_c[2];
......@@ -355,12 +355,12 @@ static int ssleay_rand_add(const void *buf, int num, double add)
return rv;
}
static int ssleay_rand_seed(const void *buf, int num)
static int rand_seed(const void *buf, int num)
{
return ssleay_rand_add(buf, num, (double)num);
return rand_add(buf, num, (double)num);
}
static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo)
static int rand_bytes(unsigned char *buf, int num, int pseudo)
{
static volatile int stirred_pool = 0;
int i, j, k, st_num, st_idx;
......@@ -433,7 +433,7 @@ static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo)
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
/* prevent ssleay_rand_bytes() from trying to obtain the lock again */
/* prevent rand_bytes() from trying to obtain the lock again */
CRYPTO_w_lock(CRYPTO_LOCK_RAND2);
CRYPTO_THREADID_current(&locking_threadid);
CRYPTO_w_unlock(CRYPTO_LOCK_RAND2);
......@@ -470,7 +470,7 @@ static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo)
* In the output function only half of 'md' remains secret, so we
* better make sure that the required entropy gets 'evenly
* distributed' through 'state', our randomness pool. The input
* function (ssleay_rand_add) chains all of 'md', which makes it more
* function (rand_add) chains all of 'md', which makes it more
* suitable for this purpose.
*/
......@@ -482,9 +482,9 @@ static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo)
#define DUMMY_SEED "...................." /* at least MD_DIGEST_LENGTH */
/*
* Note that the seed does not matter, it's just that
* ssleay_rand_add expects to have something to hash.
* rand_add expects to have something to hash.
*/
ssleay_rand_add(DUMMY_SEED, MD_DIGEST_LENGTH, 0.0);
rand_add(DUMMY_SEED, MD_DIGEST_LENGTH, 0.0);
n -= MD_DIGEST_LENGTH;
}
if (ok)
......@@ -588,34 +588,34 @@ static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo)
else if (pseudo)
return 0;
else {
RANDerr(RAND_F_SSLEAY_RAND_BYTES, RAND_R_PRNG_NOT_SEEDED);
RANDerr(RAND_F_RAND_BYTES, RAND_R_PRNG_NOT_SEEDED);
ERR_add_error_data(1, "You need to read the OpenSSL FAQ, "
"http://www.openssl.org/support/faq.html");
return (0);
}
err:
EVP_MD_CTX_cleanup(&m);
RANDerr(RAND_F_SSLEAY_RAND_BYTES, ERR_R_EVP_LIB);
RANDerr(RAND_F_RAND_BYTES, ERR_R_EVP_LIB);
return 0;
}
static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num)
static int rand_nopseudo_bytes(unsigned char *buf, int num)
{
return ssleay_rand_bytes(buf, num, 0);
return rand_bytes(buf, num, 0);
}
#ifndef OPENSSL_NO_DEPRECATED
/*
* pseudo-random bytes that are guaranteed to be unique but not unpredictable
*/
static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num)
static int rand_pseudo_bytes(unsigned char *buf, int num)
{
return ssleay_rand_bytes(buf, num, 1);
return rand_bytes(buf, num, 1);
}
#endif
static int ssleay_rand_status(void)
static int rand_status(void)
{
CRYPTO_THREADID cur;
int ret;
......@@ -637,7 +637,7 @@ static int ssleay_rand_status(void)
CRYPTO_w_lock(CRYPTO_LOCK_RAND);
/*
* prevent ssleay_rand_bytes() from trying to obtain the lock again
* prevent rand_bytes() from trying to obtain the lock again
*/
CRYPTO_w_lock(CRYPTO_LOCK_RAND2);
CRYPTO_THREADID_cpy(&locking_threadid, &cur);
......
/* crypto/rand/rand_err.c */
/* ====================================================================
* Copyright (c) 1999-2010 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -75,8 +75,8 @@ static ERR_STRING_DATA RAND_str_functs[] = {
{ERR_FUNC(RAND_F_FIPS_SET_PRNG_SEED), "FIPS_SET_PRNG_SEED"},
{ERR_FUNC(RAND_F_FIPS_SET_TEST_MODE), "FIPS_SET_TEST_MODE"},
{ERR_FUNC(RAND_F_FIPS_X931_SET_DT), "FIPS_x931_set_dt"},
{ERR_FUNC(RAND_F_RAND_BYTES), "RAND_bytes"},
{ERR_FUNC(RAND_F_RAND_GET_RAND_METHOD), "RAND_get_rand_method"},
{ERR_FUNC(RAND_F_SSLEAY_RAND_BYTES), "SSLEAY_RAND_BYTES"},
{0, NULL}
};
......
......@@ -104,7 +104,7 @@ const RAND_METHOD *RAND_get_rand_method(void)
funct_ref = e;
else
#endif
default_RAND_meth = RAND_SSLeay();
default_RAND_meth = RAND_OpenSSL();
}
return default_RAND_meth;
}
......@@ -197,7 +197,7 @@ static size_t drbg_get_entropy(DRBG_CTX *ctx, unsigned char **pout,
*pout = OPENSSL_malloc(min_len);
if (!*pout)
return 0;
if (RAND_SSLeay()->bytes(*pout, min_len) <= 0) {
if (RAND_OpenSSL()->bytes(*pout, min_len) <= 0) {
OPENSSL_free(*pout);
*pout = NULL;
return 0;
......@@ -234,12 +234,12 @@ static size_t drbg_get_adin(DRBG_CTX *ctx, unsigned char **pout)
static int drbg_rand_add(DRBG_CTX *ctx, const void *in, int inlen,
double entropy)
{
return RAND_SSLeay()->add(in, inlen, entropy);
return RAND_OpenSSL()->add(in, inlen, entropy);
}
static int drbg_rand_seed(DRBG_CTX *ctx, const void *in, int inlen)
{
return RAND_SSLeay()->seed(in, inlen);
return RAND_OpenSSL()->seed(in, inlen);
}
int RAND_init_fips(void)
......
......@@ -146,7 +146,7 @@ static RSA_METHOD rsa_pkcs1_eay_meth = {
NULL /* rsa_keygen */
};
const RSA_METHOD *RSA_PKCS1_SSLeay(void)
const RSA_METHOD *RSA_PKCS1_OpenSSL(void)
{
return (&rsa_pkcs1_eay_meth);
}
......
......@@ -87,7 +87,7 @@ const RSA_METHOD *RSA_get_default_method(void)
#ifdef RSA_NULL
default_RSA_meth = RSA_null_method();
#else
default_RSA_meth = RSA_PKCS1_SSLeay();
default_RSA_meth = RSA_PKCS1_OpenSSL();
#endif
}
......
......@@ -418,7 +418,7 @@ static int tls_init(void *apparg)
return 0;
SSL_load_error_strings();
if (!SSL_library_init() /* aka SSLeay_add_ssl_algorithms() */ ) {
if (!SSL_library_init()) {
tls_errprintf(1, apparg, "SSL_library_init failed.\n");
return -1;
}
......
......@@ -241,14 +241,14 @@ static int bind_helper(ENGINE *e)
# ifndef OPENSSL_NO_RSA
/*
* We know that the "PKCS1_SSLeay()" functions hook properly to the
* We know that the "PKCS1_OpenSSL()" functions hook properly to the
* ibmca-specific mod_exp and mod_exp_crt so we use those functions. NB:
* We don't use ENGINE_openssl() or anything "more generic" because
* something like the RSAref code may not hook properly, and if you own
* one of these cards then you have the right to do RSA operations on it
* anyway!
*/
meth1 = RSA_PKCS1_SSLeay();
meth1 = RSA_PKCS1_OpenSSL();
ibmca_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
ibmca_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
ibmca_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
......
......@@ -309,14 +309,14 @@ static int bind_helper(ENGINE *e)
}
# ifndef OPENSSL_NO_RSA
/*
* We know that the "PKCS1_SSLeay()" functions hook properly to the
* We know that the "PKCS1_OpenSSL()" functions hook properly to the
* Zencod-specific mod_exp and mod_exp_crt so we use those functions. NB:
* We don't use ENGINE_openssl() or anything "more generic" because
* something like the RSAref code may not hook properly, and if you own
* one of these cards then you have the right to do RSA operations on it
* anyway!
*/
meth_rsa = RSA_PKCS1_SSLeay();
meth_rsa = RSA_PKCS1_OpenSSL();
zencod_rsa.rsa_pub_enc = meth_rsa->rsa_pub_enc;
zencod_rsa.rsa_pub_dec = meth_rsa->rsa_pub_dec;
......@@ -358,9 +358,9 @@ static int bind_helper(ENGINE *e)
# endif
/*
* We use OpenSSL (SSLeay) meth to supply what we don't provide ;-*)
* We use OpenSSL meth to supply what we don't provide ;-*)
*/
meth_rand = RAND_SSLeay();
meth_rand = RAND_OpenSSL();
/* meth_rand->seed ; */
/* zencod_rand.seed = meth_rand->seed ; */
......@@ -776,7 +776,7 @@ static int RSA_zencod_rsa_mod_exp(BIGNUM *r0, const BIGNUM *i, RSA *rsa)
if (RSA_size(rsa) * 8 > ZENBRIDGE_MAX_KEYSIZE_RSA_CRT) {
const RSA_METHOD *meth;
meth = RSA_PKCS1_SSLeay();
meth = RSA_PKCS1_OpenSSL();
return meth->rsa_mod_exp(r0, i, rsa);
} else {
zen_nb_t y, x, p, q, dmp1, dmq1, iqmp;
......@@ -827,7 +827,7 @@ static int RSA_zencod_bn_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
if (BN_num_bits(m) > ZENBRIDGE_MAX_KEYSIZE_RSA) {
const RSA_METHOD *meth;
meth = RSA_PKCS1_SSLeay();
meth = RSA_PKCS1_OpenSSL();
return meth->bn_mod_exp(r, a, p, m, ctx, m_ctx);
} else {
zen_nb_t y, x, e, n;
......
......@@ -18,7 +18,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Usage: pkwrite infile password name p12file\n");
exit(1);
}
SSLeay_add_all_algorithms();
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
if ((fp = fopen(argv[1], "r")) == NULL) {
fprintf(stderr, "Error opening file %s\n", argv[1]);
......
......@@ -57,7 +57,7 @@
*/
/*
* sign-it.cpp - Simple test app using SSLeay envelopes to sign data
* sign-it.cpp - Simple test app using EVP envelopes to sign data
* 29.9.1996, Sampo Kellomaki <sampo@iki.fi>
*/
......
/* cli.cpp - Minimal ssleay client for Unix
30.9.1996, Sampo Kellomaki <sampo@iki.fi> */
/* mangled to work with SSLeay-0.9.0b and OpenSSL 0.9.2b
/* mangled to work with OpenSSL 0.9.2b
Simplified to be even more minimal
12/98 - 4/99 Wade Scholine <wades@mail.cybg.com> */
......@@ -37,7 +37,7 @@ void main ()
char buf [4096];
SSL_METHOD *meth;
SSLeay_add_ssl_algorithms();
OpenSSL_add_ssl_algorithms();
meth = TLS_client_method();
SSL_load_error_strings();
ctx = SSL_CTX_new (meth); CHK_NULL(ctx);
......
......@@ -7,7 +7,7 @@
#include <stdio.h>
#include <errno.h>
#include "rsa.h" /* SSLeay stuff */
#include "rsa.h"
#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
......
......@@ -2,7 +2,7 @@
30.9.1996, Sampo Kellomaki <sampo@iki.fi> */
/* mangled to work with SSLeay-0.9.0b and OpenSSL 0.9.2b
/* mangled to work with OpenSSL 0.9.2b
Simplified to be even more minimal
12/98 - 4/99 Wade Scholine <wades@mail.cybg.com> */
......@@ -17,7 +17,7 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <openssl/rsa.h> /* SSLeay stuff */
#include <openssl/rsa.h>
#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
......@@ -54,7 +54,7 @@ void main ()
/* SSL preliminaries. We keep the certificate and key with the context. */
SSL_load_error_strings();
SSLeay_add_ssl_algorithms();
OpenSSL_add_ssl_algorithms();
meth = TLS_server_method();
ctx = SSL_CTX_new (meth);
if (!ctx) {
......
......@@ -117,7 +117,7 @@ for all available algorithms.
=head1 WARNINGS
The program B<dhparam> combines the functionality of the programs B<dh> and
B<gendh> in previous versions of OpenSSL and SSLeay. The B<dh> and B<gendh>
B<gendh> in previous versions of OpenSSL. The B<dh> and B<gendh>
programs are retained for now but may have different purposes in future
versions of OpenSSL.
......
......@@ -62,8 +62,7 @@ use a salt in the key derivation routines. This is the default.
=item B<-nosalt>
don't use a salt in the key derivation routines. This option B<SHOULD NOT> be
used except for test purposes or compatibility with ancient versions of OpenSSL
and SSLeay.
used except for test purposes or compatibility with ancient versions of OpenSSL.
=item B<-e>
......@@ -181,7 +180,7 @@ A password will be prompted for to derive the key and IV if necessary.
The B<-salt> option should B<ALWAYS> be used if the key is being derived
from a password unless you want compatibility with previous versions of
OpenSSL and SSLeay.
OpenSSL.
Without the B<-salt> option it is possible to perform efficient dictionary
attacks on the password and to attack stream cipher encrypted data. The reason
......
......@@ -621,8 +621,7 @@ for more information.
The variable B<OPENSSL_CONF> if defined allows an alternative configuration
file location to be specified, it will be overridden by the B<-config> command
line switch if it is present. For compatibility reasons the B<SSLEAY_CONF>
environment variable serves the same purpose but its use is discouraged.
line switch if it is present.
=head1 BUGS
......
......@@ -307,7 +307,7 @@ the B<CERTIFICATE EXTENSIONS> section of the B<x509> utility.
The third operation is to check the trust settings on the root CA. The root
CA should be trusted for the supplied purpose. For compatibility with previous
versions of SSLeay and OpenSSL a certificate with no trust settings is considered
versions of OpenSSL, a certificate with no trust settings is considered
to be valid for all purposes.
The final operation is to check the validity of the certificate chain. The validity
......
......@@ -2,7 +2,8 @@
=head1 NAME
OPENSSL_VERSION_NUMBER, OpenSSL_version - get OpenSSL version number
OPENSSL_VERSION_NUMBER, OpenSSL_version,
OpenSSL_version_num - get OpenSSL version number
=head1 SYNOPSIS
......@@ -10,6 +11,8 @@ OPENSSL_VERSION_NUMBER, OpenSSL_version - get OpenSSL version number
#define OPENSSL_VERSION_NUMBER 0xnnnnnnnnnL
#include <openssl/crypto.h>
unsigned long OpenSSL_version_num();
const char *OpenSSL_version(int t);
=head1 DESCRIPTION
......@@ -42,8 +45,7 @@ Version 0.9.5a had an interim interpretation that is like the current one,
except the patch level got the highest bit set, to keep continuity. The
number was therefore 0x0090581f.
For backward compatibility, OPENSSL_VERSION_NUMBER is also defined.
OpenSSL_version_num() returns the version number.
OpenSSL_version() returns different strings depending on B<t>:
......
......@@ -2,7 +2,7 @@
=head1 NAME
RAND_set_rand_method, RAND_get_rand_method, RAND_SSLeay - select RAND method
RAND_set_rand_method, RAND_get_rand_method, RAND_OpenSSL - select RAND method
=head1 SYNOPSIS
......@@ -12,7 +12,7 @@ RAND_set_rand_method, RAND_get_rand_method, RAND_SSLeay - select RAND method
const RAND_METHOD *RAND_get_rand_method(void);
RAND_METHOD *RAND_SSLeay(void);
RAND_METHOD *RAND_OpenSSL(void);
=head1 DESCRIPTION
......@@ -23,7 +23,7 @@ information about how these RAND API functions are affected by the use of
B<ENGINE> API calls.
Initially, the default RAND_METHOD is the OpenSSL internal implementation, as
returned by RAND_SSLeay().
returned by RAND_OpenSSL().
RAND_set_default_method() makes B<meth> the method for PRNG use. B<NB>: This is
true only whilst no ENGINE has been set as a default for RAND, so this function
......@@ -53,7 +53,7 @@ Each component may be NULL if the function is not implemented.
=head1 RETURN VALUES
RAND_set_rand_method() returns no value. RAND_get_rand_method() and
RAND_SSLeay() return pointers to the respective methods.
RAND_OpenSSL() return pointers to the respective methods.
=head1 NOTES
......
=pod
=head1 NAME
SSLeay_version - retrieve version/build information about OpenSSL library
=head1 SYNOPSIS
#include <openssl/crypto.h>
const char *SSLeay_version(int type);
=head1 DESCRIPTION
SSLeay_version() returns a pointer to a constant string describing the
version of the OpenSSL library or giving information about the library
build.
The following B<type> values are supported:
=over 4
=item SSLEAY_VERSION
The version of the OpenSSL library including the release date.
=item SSLEAY_CFLAGS
The compiler flags set for the compilation process in the form
"compiler: ..." if available or "compiler: information not available"
otherwise.
=item SSLEAY_BUILT_ON
The date of the build process in the form "built on: ..." if available
or "built on: date not available" otherwise.
=item SSLEAY_PLATFORM
The "Configure" target of the library build in the form "platform: ..."
if available or "platform: information not available" otherwise.
=item SSLEAY_DIR
The "OPENSSLDIR" setting of the library build in the form "OPENSSLDIR: "...""
if available or "OPENSSLDIR: N/A" otherwise.
=back
=head1 RETURN VALUES
The following return values can occur:
=over 4
=item "not available"
An invalid value for B<type> was given.
=item Pointer to constant string
Textual description.
=back
=head1 SEE ALSO
L<crypto(3)>
=cut
......@@ -2,7 +2,7 @@
=head1 NAME
SSL_library_init, OpenSSL_add_ssl_algorithms, SSLeay_add_ssl_algorithms
SSL_library_init, OpenSSL_add_ssl_algorithms,
- initialize SSL library by registering algorithms
=head1 SYNOPSIS
......@@ -11,14 +11,12 @@ SSL_library_init, OpenSSL_add_ssl_algorithms, SSLeay_add_ssl_algorithms
int SSL_library_init(void);
#define OpenSSL_add_ssl_algorithms() SSL_library_init()
#define SSLeay_add_ssl_algorithms() SSL_library_init()
=head1 DESCRIPTION
SSL_library_init() registers the available SSL/TLS ciphers and digests.
OpenSSL_add_ssl_algorithms() and SSLeay_add_ssl_algorithms() are synonyms
for SSL_library_init().
OpenSSL_add_ssl_algorithms() is a synonym for SSL_library_init().
=head1 NOTES
......
......@@ -328,7 +328,6 @@ extern FILE *_imp___iob;
# define R_OK 4
# endif
# define OPENSSL_CONF "openssl.cnf"
# define SSLEAY_CONF OPENSSL_CONF
# define NUL_DEV "nul"
# define RFILE ".rnd"
# ifdef OPENSSL_SYS_WINCE
......@@ -361,7 +360,6 @@ extern FILE *_imp___iob;
# include <unixlib.h>
# endif
# define OPENSSL_CONF "openssl.cnf"
# define SSLEAY_CONF OPENSSL_CONF
# define RFILE ".rnd"
# define LIST_SEPARATOR_CHAR ','
# define NUL_DEV "NLA0:"
......@@ -412,7 +410,6 @@ extern int kbhit(void);
# define _O_TEXT O_TEXT
# define _O_BINARY O_BINARY
# define OPENSSL_CONF "openssl.cnf"
# define SSLEAY_CONF OPENSSL_CONF
# define RFILE ".rnd"
# define LIST_SEPARATOR_CHAR ';'
# define EXIT(n) { if (n) printf("ERROR: %d\n", (int)n); exit(n); }
......@@ -433,14 +430,13 @@ extern int kbhit(void);
# endif
# define OPENSSL_CONF "openssl.cnf"
# define SSLEAY_CONF OPENSSL_CONF
# define RFILE ".rnd"
# define LIST_SEPARATOR_CHAR ':'
# define NUL_DEV "/dev/null"
# define EXIT(n) exit(n)
# endif
# define SSLeay_getpid() getpid()
# define OpenSSL_getpid() getpid()
# endif
......@@ -455,8 +451,8 @@ extern int kbhit(void);
/* windows world */
# ifdef OPENSSL_NO_SOCK
# define SSLeay_Write(a,b,c) (-1)
# define SSLeay_Read(a,b,c) (-1)
# define OpenSSL_Write(a,b,c) (-1)
# define OpenSSL_Read(a,b,c) (-1)
# define SHUTDOWN(fd) close(fd)
# define SHUTDOWN2(fd) close(fd)
# elif !defined(__DJGPP__)
......@@ -484,13 +480,13 @@ struct servent *PASCAL getservbyname(const char *, const char *);
# define socket(d,t,p) ((int)socket(d,t,p))
# define accept(s,f,l) ((int)accept(s,f,l))
# endif
# define SSLeay_Write(a,b,c) send((a),(b),(c),0)
# define SSLeay_Read(a,b,c) recv((a),(b),(c),0)
# define OpenSSL_Write(a,b,c) send((a),(b),(c),0)
# define OpenSSL_Read(a,b,c) recv((a),(b),(c),0)
# define SHUTDOWN(fd) { shutdown((fd),0); closesocket(fd); }
# define SHUTDOWN2(fd) { shutdown((fd),2); closesocket(fd); }
# else
# define SSLeay_Write(a,b,c) write_s(a,b,c,0)
# define SSLeay_Read(a,b,c) read_s(a,b,c)
# define OpenSSL_Write(a,b,c) write_s(a,b,c,0)
# define OpenSSL_Read(a,b,c) read_s(a,b,c)
# define SHUTDOWN(fd) close_s(fd)
# define SHUTDOWN2(fd) close_s(fd)
# endif
......@@ -513,8 +509,8 @@ struct servent *PASCAL getservbyname(const char *, const char *);
# else
# include <novsock2.h>
# endif
# define SSLeay_Write(a,b,c) send((a),(b),(c),0)
# define SSLeay_Read(a,b,c) recv((a),(b),(c),0)
# define OpenSSL_Write(a,b,c) send((a),(b),(c),0)
# define OpenSSL_Read(a,b,c) recv((a),(b),(c),0)
# define SHUTDOWN(fd) { shutdown((fd),0); closesocket(fd); }
# define SHUTDOWN2(fd) { shutdown((fd),2); closesocket(fd); }
......@@ -579,8 +575,8 @@ struct servent *PASCAL getservbyname(const char *, const char *);
# endif
# endif
# define SSLeay_Read(a,b,c) read((a),(b),(c))
# define SSLeay_Write(a,b,c) write((a),(b),(c))
# define OpenSSL_Read(a,b,c) read((a),(b),(c))
# define OpenSSL_Write(a,b,c) write((a),(b),(c))
# define SHUTDOWN(fd) { shutdown((fd),0); closesocket((fd)); }
# define SHUTDOWN2(fd) { shutdown((fd),2); closesocket((fd)); }
# ifndef INVALID_SOCKET
......
......@@ -472,7 +472,7 @@ static int capi_init(ENGINE *e)
/* Setup RSA_METHOD */
rsa_capi_idx = RSA_get_ex_new_index(0, NULL, NULL, NULL, 0);
ossl_rsa_meth = RSA_PKCS1_SSLeay();
ossl_rsa_meth = RSA_PKCS1_OpenSSL();
capi_rsa_method.rsa_pub_enc = ossl_rsa_meth->rsa_pub_enc;
capi_rsa_method.rsa_pub_dec = ossl_rsa_meth->rsa_pub_dec;
capi_rsa_method.rsa_mod_exp = ossl_rsa_meth->rsa_mod_exp;
......
......@@ -376,14 +376,14 @@ static int bind_helper(ENGINE *e)
# ifndef OPENSSL_NO_RSA
/*
* We know that the "PKCS1_SSLeay()" functions hook properly to the
* We know that the "PKCS1_OpenSSL()" functions hook properly to the
* cswift-specific mod_exp and mod_exp_crt so we use those functions. NB:
* We don't use ENGINE_openssl() or anything "more generic" because
* something like the RSAref code may not hook properly, and if you own
* one of these cards then you have the right to do RSA operations on it
* anyway!
*/
meth1 = RSA_PKCS1_SSLeay();
meth1 = RSA_PKCS1_OpenSSL();
hwcrhk_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
hwcrhk_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
hwcrhk_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
......
......@@ -170,7 +170,7 @@ static int bind_helper(ENGINE *e)
return 0;
# ifndef OPENSSL_NO_RSA
meth1 = RSA_PKCS1_SSLeay();
meth1 = RSA_PKCS1_OpenSSL();
e_gmp_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
e_gmp_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
e_gmp_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
......
......@@ -233,14 +233,14 @@ static int bind_helper(ENGINE *e)
# ifndef OPENSSL_NO_RSA
/*
* We know that the "PKCS1_SSLeay()" functions hook properly to the
* We know that the "PKCS1_OpenSSL()" functions hook properly to the
* Broadcom-specific mod_exp and mod_exp_crt so we use those functions.
* NB: We don't use ENGINE_openssl() or anything "more generic" because
* something like the RSAref code may not hook properly, and if you own
* one of these cards then you have the right to do RSA operations on it
* anyway!
*/
meth1 = RSA_PKCS1_SSLeay();
meth1 = RSA_PKCS1_OpenSSL();
ubsec_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
ubsec_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
ubsec_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
......@@ -611,7 +611,7 @@ static int ubsec_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa,
/*
* Do in software as hardware failed.
*/
const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
const RSA_METHOD *meth = RSA_PKCS1_OpenSSL();
to_return = (*meth->rsa_mod_exp) (r0, I, rsa, ctx);
}
err:
......@@ -679,7 +679,7 @@ static int ubsec_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
/* Do in software if the key is too large for the hardware. */
if (BN_num_bits(m) > max_key_len) {
const RSA_METHOD *meth = RSA_PKCS1_SSLeay();
const RSA_METHOD *meth = RSA_PKCS1_OpenSSL();
ret = (*meth->bn_mod_exp) (r, a, p, m, ctx, m_ctx);
} else {
ret = ubsec_mod_exp(r, a, p, m, ctx);
......@@ -978,7 +978,7 @@ static int ubsec_rand_bytes(unsigned char *buf, int num)
const RAND_METHOD *meth;
UBSECerr(UBSEC_F_UBSEC_RAND_BYTES, UBSEC_R_UNIT_FAILURE);
num = p_UBSEC_ubsec_bits_to_bytes(num);
meth = RAND_SSLeay();
meth = RAND_OpenSSL();
meth->seed(buf, num);
ret = meth->bytes(buf, num);
goto err;
......@@ -994,7 +994,7 @@ static int ubsec_rand_bytes(unsigned char *buf, int num)
p_UBSEC_ubsec_close(fd);
num = p_UBSEC_ubsec_bits_to_bytes(num);
meth = RAND_SSLeay();
meth = RAND_OpenSSL();
meth->seed(buf, num);
ret = meth->bytes(buf, num);
......
......@@ -145,19 +145,6 @@
extern "C" {
#endif
/* Backward compatibility to SSLeay */
/*
* This is more to be used to check the correct DLL is being used in the MS
* world.
*/
# define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
# define SSLEAY_VERSION 0
/* #define SSLEAY_OPTIONS 1 no longer supported */
# define SSLEAY_CFLAGS 2
# define SSLEAY_BUILT_ON 3
# define SSLEAY_PLATFORM 4
# define SSLEAY_DIR 5
/*
* When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock
* names in cryptlib.c
......@@ -243,7 +230,7 @@ typedef struct {
} CRYPTO_dynlock;
/*
* The following can be used to detect memory leaks in the SSLeay library. It
* The following can be used to detect memory leaks in the OpenSSL library. It
* used, it turns on malloc checking
*/
......@@ -350,8 +337,13 @@ int CRYPTO_is_mem_check_on(void);
# define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U<<(sizeof(int)*8-1))-1)/sizeof(type))
const char *SSLeay_version(int type);
unsigned long SSLeay(void);
unsigned long OpenSSL_version_num(void);
const char *OpenSSL_version(int type);
# define OPENSSL_VERSION 0
# define OPENSSL_CFLAGS 1
# define OPENSSL_BUILT_ON 2
# define OPENSSL_PLATFORM 3
# define OPENSSL_DIR 4
int OPENSSL_issetugid(void);
......
......@@ -58,9 +58,8 @@
/*
* The DSS routines are based on patches supplied by
* Steven Schoch <schoch@sheba.arc.nasa.gov>. He basically did the
* work and I have just tweaked them a little to fit into my
* stylistic vision for SSLeay :-) */
* Steven Schoch <schoch@sheba.arc.nasa.gov>.
*/
#ifndef HEADER_DSA_H
# define HEADER_DSA_H
......
......@@ -959,9 +959,6 @@ void OPENSSL_add_all_algorithms_conf(void);
void OpenSSL_add_all_ciphers(void);
void OpenSSL_add_all_digests(void);
# define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms()
# define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers()
# define SSLeay_add_all_digests() OpenSSL_add_all_digests()
int EVP_add_cipher(const EVP_CIPHER *cipher);
int EVP_add_digest(const EVP_MD *digest);
......
......@@ -92,7 +92,7 @@ const RAND_METHOD *RAND_get_rand_method(void);
# ifndef OPENSSL_NO_ENGINE
int RAND_set_rand_engine(ENGINE *engine);
# endif
RAND_METHOD *RAND_SSLeay(void);
RAND_METHOD *RAND_OpenSSL(void);
void RAND_cleanup(void);
int RAND_bytes(unsigned char *buf, int num);
#ifdef OPENSSL_USE_DEPRECATED
......@@ -138,8 +138,8 @@ void ERR_load_RAND_strings(void);
# define RAND_F_FIPS_SET_PRNG_SEED 104
# define RAND_F_FIPS_SET_TEST_MODE 105
# define RAND_F_FIPS_X931_SET_DT 106
# define RAND_F_RAND_BYTES 100
# define RAND_F_RAND_GET_RAND_METHOD 101
# define RAND_F_SSLEAY_RAND_BYTES 100
/* Reason codes. */
# define RAND_R_NOT_IN_TEST_MODE 101
......
......@@ -365,8 +365,8 @@ int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
/* This function needs the memory locking malloc callbacks to be installed */
int RSA_memory_lock(RSA *r);
/* these are the actual SSLeay RSA functions */
const RSA_METHOD *RSA_PKCS1_SSLeay(void);
/* these are the actual RSA functions */
const RSA_METHOD *RSA_PKCS1_OpenSSL(void);
const RSA_METHOD *RSA_null_method(void);
......
......@@ -163,7 +163,7 @@
extern "C" {
#endif
/* SSLeay version number for ASN.1 encoding of the session information */
/* OpenSSL version number for ASN.1 encoding of the session information */
/*-
* Version 0 - initial version
* Version 1 - added the optional peer certificate
......@@ -438,20 +438,10 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type,
# define SSL_OP_NO_SSL_MASK (SSL_OP_NO_SSLv3|\
SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2)
/*
* These next two were never actually used for anything since SSLeay zap so
* we have some more flags.
*/
/*
* The next flag deliberately changes the ciphertest, this is a check for the
* PKCS#1 attack
*/
/* Removed from previous versions */
# define SSL_OP_PKCS1_CHECK_1 0x0
# define SSL_OP_PKCS1_CHECK_2 0x0
/* Removed as of OpenSSL 1.1.0 */
# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0
/* Removed as of OpenSSL 1.1.0 */
# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0L
/*
* Make server add server-hello extension from early version of cryptopro
......@@ -1034,7 +1024,6 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count);
# define SSL_VERIFY_CLIENT_ONCE 0x04
# define OpenSSL_add_ssl_algorithms() SSL_library_init()
# define SSLeay_add_ssl_algorithms() SSL_library_init()
/* More backward compatibility */
# define SSL_get_cipher(s) \
......
......@@ -233,8 +233,7 @@ DECLARE_STACK_OF(X509_TRUST)
# define XN_FLAG_SEP_MASK (0xf << 16)
# define XN_FLAG_COMPAT 0/* Traditional SSLeay: use old
* X509_NAME_print */
# define XN_FLAG_COMPAT 0/* Traditional; use old X509_NAME_print */
# define XN_FLAG_SEP_COMMA_PLUS (1 << 16)/* RFC2253 ,+ */
# define XN_FLAG_SEP_CPLUS_SPC (2 << 16)/* ,+ spaced: more readable */
# define XN_FLAG_SEP_SPLUS_SPC (3 << 16)/* ;+ spaced */
......
......@@ -21,17 +21,17 @@ remove_tree("demoCA", { safe => 0 });
plan tests => 4;
SKIP: {
$ENV{SSLEAY_CONFIG} = "-config ".top_file("test", "CAss.cnf");
$ENV{OPENSSL_CONFIG} = "-config ".top_file("test", "CAss.cnf");
skip "failed creating CA structure", 3
if !is(system("$perl ".$CA_pl." -newca < ".devnull()." 2>&1"), 0,
'creating CA structure');
$ENV{SSLEAY_CONFIG} = "-config ".top_file("test", "Uss.cnf");
$ENV{OPENSSL_CONFIG} = "-config ".top_file("test", "Uss.cnf");
skip "failed creating new certificate request", 2
if !is(system("$perl ".$CA_pl." -newreq 2>&1"), 0,
'creating new certificate request');
$ENV{SSLEAY_CONFIG} = "-config ".$std_openssl_cnf;
$ENV{OPENSSL_CONFIG} = "-config ".$std_openssl_cnf;
skip "failed to sign certificate request", 1
if !is(yes("$perl ".$CA_pl." -sign 2>&1"), 0,
'signing certificate request');
......
......@@ -74,7 +74,7 @@ indir "tsa" => sub
{
$ENV{OPENSSL_CONF} = top_file("test", "CAtsa.cnf");
# Because that's what ../apps/CA.pl really looks at
$ENV{SSLEAY_CONFIG} = "-config ".$ENV{OPENSSL_CONF};
$ENV{OPENSSL_CONFIG} = "-config ".$ENV{OPENSSL_CONF};
$ENV{OPENSSL} = cmdstr(app(["openssl"]));
$testtsa = top_file("test", "recipes", "80-test_tsa.t");
$CAtsa = top_file("test", "CAtsa.cnf");
......
SSLeay 1 EXIST::FUNCTION:
SSLeay_version 2 EXIST::FUNCTION:
OpenSSL_version_num 1 EXIST::FUNCTION:
OpenSSL_version 2 EXIST::FUNCTION:
ASN1_BIT_STRING_asn1_meth 3 NOEXIST::FUNCTION:
ASN1_HEADER_free 4 NOEXIST::FUNCTION:
ASN1_HEADER_new 5 NOEXIST::FUNCTION:
......@@ -472,7 +472,7 @@ RC4_set_key 479 EXIST::FUNCTION:RC4
RSAPrivateKey_asn1_meth 480 NOEXIST::FUNCTION:
RSAPrivateKey_dup 481 EXIST::FUNCTION:RSA
RSAPublicKey_dup 482 EXIST::FUNCTION:RSA
RSA_PKCS1_SSLeay 483 EXIST::FUNCTION:RSA
RSA_PKCS1_OpenSSL 483 EXIST::FUNCTION:RSA
RSA_free 484 EXIST::FUNCTION:RSA
RSA_generate_key 485 EXIST::FUNCTION:DEPRECATED,RSA
RSA_new 486 EXIST::FUNCTION:RSA
......@@ -1082,7 +1082,7 @@ BN_MONT_CTX_copy 1109 EXIST::FUNCTION:
BIO_new_socks4a_connect 1110 NOEXIST::FUNCTION:
BIO_s_socks4a_connect 1111 NOEXIST::FUNCTION:
PROXY_set_connect_mode 1112 NOEXIST::FUNCTION:
RAND_SSLeay 1113 EXIST::FUNCTION:
RAND_OpenSSL 1113 EXIST::FUNCTION:
RAND_set_rand_method 1114 EXIST::FUNCTION:
RSA_memory_lock 1115 EXIST::FUNCTION:RSA
bn_sub_words 1116 NOEXIST::FUNCTION:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册