提交 f5d7a031 编写于 作者: U Ulf Möller

New Configure option no-<cipher> (rsa, idea, rc5, ...).

上级 b64f8256
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
Changes between 0.9.2b and 0.9.3 Changes between 0.9.2b and 0.9.3
*) New Configure option no-<cipher> (rsa, idea, rc5, ...).
[Ulf Möller]
*) Add the PKCS#12 API documentation to openssl.txt. Preliminary support for *) Add the PKCS#12 API documentation to openssl.txt. Preliminary support for
extension adding in x509 utility. extension adding in x509 utility.
[Steve Henson] [Steve Henson]
......
...@@ -20,16 +20,9 @@ my $usage="Usage: Configure [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [rsaref] [no ...@@ -20,16 +20,9 @@ my $usage="Usage: Configure [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [rsaref] [no
# rsaref use RSAref # rsaref use RSAref
# no-asm do not use assembler # no-asm do not use assembler
# 386 generate 80386 code # 386 generate 80386 code
# no-CIPHER build without specified algorithm
# -D, -L, -l, -f, -K: compiler options are passed through # -D, -L, -l, -f, -K: compiler options are passed through
# #
# -DRSAref build to use RSAref
# -DNO_IDEA build with no IDEA algorithm
# -DNO_RC4 build with no RC4 algorithm
# -DNO_RC2 build with no RC2 algorithm
# -DNO_BF build with no Blowfish algorithm
# -DNO_DES build with no DES/3DES algorithm
# -DNO_MD2 build with no MD2 algorithm
#
# DES_PTR use pointer lookup vs arrays in the DES in crypto/des/des_locl.h # DES_PTR use pointer lookup vs arrays in the DES in crypto/des/des_locl.h
# DES_RISC1 use different DES_ENCRYPT macro that helps reduce register # DES_RISC1 use different DES_ENCRYPT macro that helps reduce register
# dependancies but needs to more registers, good for RISC CPU's # dependancies but needs to more registers, good for RISC CPU's
...@@ -255,6 +248,7 @@ my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32 ...@@ -255,6 +248,7 @@ my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32
my $installprefix=""; my $installprefix="";
my $openssldir=""; my $openssldir="";
my $no_asm=0; my $no_asm=0;
my @skip=();
my $Makefile="Makefile.ssl"; my $Makefile="Makefile.ssl";
my $des_locl="crypto/des/des_locl.h"; my $des_locl="crypto/des/des_locl.h";
my $des ="crypto/des/des.h"; my $des ="crypto/des/des.h";
...@@ -284,12 +278,21 @@ $perl=&which("perl5") or $perl=&which("perl"); ...@@ -284,12 +278,21 @@ $perl=&which("perl5") or $perl=&which("perl");
&usage if ($#ARGV < 0); &usage if ($#ARGV < 0);
my $flags=""; my $flags="";
my $depflags="";
my $libs=""; my $libs="";
my $target=""; my $target="";
foreach (@ARGV) foreach (@ARGV)
{ {
if (/^no-asm$/) if (/^no-asm$/)
{ $no_asm=1; } { $no_asm=1; }
elsif (/^no-(.+)$/)
{
my $algo=$1;
push @skip,$algo;
$algo =~ tr/[a-z]/[A-Z]/;
$flags .= "-DNO_$algo ";
$depflags .= "-DNO_$algo ";
}
elsif (/^386$/) elsif (/^386$/)
{ $processor=386; } { $processor=386; }
elsif (/^rsaref$/) elsif (/^rsaref$/)
...@@ -390,14 +393,24 @@ if ($rmd160_obj =~ /\.o$/) ...@@ -390,14 +393,24 @@ if ($rmd160_obj =~ /\.o$/)
open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n"; open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
open(OUT,">$Makefile") || die "unable to create $Makefile:$!\n"; open(OUT,">$Makefile") || die "unable to create $Makefile:$!\n";
my $sdirs=0;
while (<IN>) while (<IN>)
{ {
chop; chop;
$sdirs = 1 if /^SDIRS=/;
$sdirs = 0 unless /\\$/;
if ($sdirs) {
my $dir;
foreach $dir (@skip) {
s/$dir//;
}
}
s/^INSTALLTOP=.*$/INSTALLTOP=$installprefix/; s/^INSTALLTOP=.*$/INSTALLTOP=$installprefix/;
s/^OPENSSLDIR=.*$/OPENSSLDIR=$openssldir/; s/^OPENSSLDIR=.*$/OPENSSLDIR=$openssldir/;
s/^PLATFORM=.*$/PLATFORM=$target/; s/^PLATFORM=.*$/PLATFORM=$target/;
s/^CC=.*$/CC= $cc/; s/^CC=.*$/CC= $cc/;
s/^CFLAG=.*$/CFLAG= $cflags/; s/^CFLAG=.*$/CFLAG= $cflags/;
s/^DEPFLAG=.*$/DEPFLAG= $depflags/;
s/^EX_LIBS=.*$/EX_LIBS= $lflags/; s/^EX_LIBS=.*$/EX_LIBS= $lflags/;
s/^BN_ASM=.*$/BN_ASM= $bn_obj/; s/^BN_ASM=.*$/BN_ASM= $bn_obj/;
s/^DES_ENC=.*$/DES_ENC= $des_obj/; s/^DES_ENC=.*$/DES_ENC= $des_obj/;
...@@ -551,6 +564,7 @@ if($IsWindows) { ...@@ -551,6 +564,7 @@ if($IsWindows) {
close(OUT); close(OUT);
} else { } else {
(system 'make -f Makefile.ssl links') == 0 or exit $?; (system 'make -f Makefile.ssl links') == 0 or exit $?;
(system 'make depend') == 0 or exit $? if $depflags ne "";
&dofile("tools/c_rehash",$openssldir,'^DIR=', 'DIR=%s',); &dofile("tools/c_rehash",$openssldir,'^DIR=', 'DIR=%s',);
&dofile("util/mk1mf.pl",$openssldir, &dofile("util/mk1mf.pl",$openssldir,
('^\$INSTALLTOP=','$INSTALLTOP="%s";',)); ('^\$INSTALLTOP=','$INSTALLTOP="%s";',));
......
...@@ -43,6 +43,7 @@ OPENSSLDIR=/usr/local/ssl ...@@ -43,6 +43,7 @@ OPENSSLDIR=/usr/local/ssl
CC= gcc CC= gcc
#CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
DEPFLAG=
PEX_LIBS= -L. -L.. -L../.. -L../../.. PEX_LIBS= -L. -L.. -L../.. -L../../..
EX_LIBS= EX_LIBS=
AR=ar r AR=ar r
...@@ -246,7 +247,7 @@ depend: ...@@ -246,7 +247,7 @@ depend:
@for i in $(DIRS) ;\ @for i in $(DIRS) ;\
do \ do \
(cd $$i && echo "making dependancies $$i..." && \ (cd $$i && echo "making dependancies $$i..." && \
$(MAKE) SDIRS='${SDIRS}' depend ) || exit 1; \ $(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' depend ) || exit 1; \
done; done;
lint: lint:
......
OpenSSL STATUS Last modified at OpenSSL STATUS Last modified at
______________ $Date: 1999/04/27 00:36:14 $ ______________ $Date: 1999/04/27 01:13:19 $
DEVELOPMENT STATE DEVELOPMENT STATE
...@@ -149,13 +149,6 @@ ...@@ -149,13 +149,6 @@
o Properly initialize the PRNG in the absence of /dev/random. o Properly initialize the PRNG in the absence of /dev/random.
o > NO_RSA (ejs@bfd.com)
> ./Configure -DNO_IDEA -DNO_RC5 -DNO_RC4 -DNO_RC2 -DNO_RSA -DNO_ERR linux-elf
> I tried for a whole day to do this and could not get it to work. Linux
> machine, kernel 2.0.36 and 2.2.1, redhat 5.2 latest, gcc and egcs , no
> go. I also noticed the even with -DNO_IDEA, _DNO_RC2, etc. the make
> still goes into those subdirectories and 'makes'.
o ERR_error_string(..., buf) does not know how large buf is, o ERR_error_string(..., buf) does not know how large buf is,
there should be ERR_error_string_n(..., buf, bufsize) there should be ERR_error_string_n(..., buf, bufsize)
or similar. or similar.
......
...@@ -109,7 +109,7 @@ lint: ...@@ -109,7 +109,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(SRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(SRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -66,6 +66,10 @@ ...@@ -66,6 +66,10 @@
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#if defined(NO_RSA) && !defined(NO_SSL2)
#define NO_SSL2
#endif
#undef PROG #undef PROG
#define PROG ciphers_main #define PROG ciphers_main
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DH
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
...@@ -308,3 +309,4 @@ end: ...@@ -308,3 +309,4 @@ end:
if (dh != NULL) DH_free(dh); if (dh != NULL) DH_free(dh);
EXIT(ret); EXIT(ret);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DSA
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -252,4 +253,4 @@ end: ...@@ -252,4 +253,4 @@ end:
if (dsa != NULL) DSA_free(dsa); if (dsa != NULL) DSA_free(dsa);
EXIT(ret); EXIT(ret);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DSA
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
...@@ -349,3 +350,4 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg) ...@@ -349,3 +350,4 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg)
p=n; p=n;
#endif #endif
} }
#endif
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/objects.h> #include <openssl/objects.h>
#include <openssl/x509.h> #include <openssl/x509.h>
#ifdef NO_MD5 #ifndef NO_MD5
#include <openssl/md5.h> #include <openssl/md5.h>
#endif #endif
#include <openssl/pem.h> #include <openssl/pem.h>
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DH
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -219,5 +220,4 @@ static long dh_load_rand(char *name) ...@@ -219,5 +220,4 @@ static long dh_load_rand(char *name)
} }
return(tot); return(tot);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DSA
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -228,5 +229,4 @@ static long dsa_load_rand(char *name) ...@@ -228,5 +229,4 @@ static long dsa_load_rand(char *name)
} }
return(tot); return(tot);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_RSA
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -262,5 +263,4 @@ static long gr_load_rand(char *name) ...@@ -262,5 +263,4 @@ static long gr_load_rand(char *name)
} }
return(tot); return(tot);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_RSA
#include <stdio.h> #include <stdio.h>
#include <openssl/rsa.h> #include <openssl/rsa.h>
#include <openssl/evp.h> #include <openssl/evp.h>
...@@ -166,3 +167,4 @@ err: ...@@ -166,3 +167,4 @@ err:
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
EXIT(1); EXIT(1);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_RSA
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -298,4 +299,4 @@ end: ...@@ -298,4 +299,4 @@ end:
if (rsa != NULL) RSA_free(rsa); if (rsa != NULL) RSA_free(rsa);
EXIT(ret); EXIT(ret);
} }
#endif
...@@ -70,6 +70,10 @@ ...@@ -70,6 +70,10 @@
#include <openssl/pem.h> #include <openssl/pem.h>
#include "s_apps.h" #include "s_apps.h"
#if defined(NO_RSA) && !defined(NO_SSL2)
#define NO_SSL2
#endif
#undef PROG #undef PROG
#define PROG s_client_main #define PROG s_client_main
......
...@@ -74,7 +74,13 @@ ...@@ -74,7 +74,13 @@
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include "s_apps.h" #include "s_apps.h"
#if defined(NO_RSA) && !defined(NO_SSL2)
#define NO_SSL2
#endif
#ifndef NO_RSA
static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export,int keylength); static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export,int keylength);
#endif
static int sv_body(char *hostname, int s, unsigned char *context); static int sv_body(char *hostname, int s, unsigned char *context);
static int www_body(char *hostname, int s, unsigned char *context); static int www_body(char *hostname, int s, unsigned char *context);
static void close_accept_socket(void ); static void close_accept_socket(void );
...@@ -470,6 +476,7 @@ bad: ...@@ -470,6 +476,7 @@ bad:
goto end; goto end;
} }
#ifndef NO_RSA
#if 1 #if 1
SSL_CTX_set_tmp_rsa_callback(ctx,tmp_rsa_cb); SSL_CTX_set_tmp_rsa_callback(ctx,tmp_rsa_cb);
#else #else
...@@ -490,6 +497,7 @@ bad: ...@@ -490,6 +497,7 @@ bad:
RSA_free(rsa); RSA_free(rsa);
BIO_printf(bio_s_out,"\n"); BIO_printf(bio_s_out,"\n");
} }
#endif
#endif #endif
if (cipher != NULL) if (cipher != NULL)
...@@ -1199,6 +1207,7 @@ err: ...@@ -1199,6 +1207,7 @@ err:
return(ret); return(ret);
} }
#ifndef NO_RSA
static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength) static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength)
{ {
static RSA *rsa_tmp=NULL; static RSA *rsa_tmp=NULL;
...@@ -1210,9 +1219,7 @@ static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength) ...@@ -1210,9 +1219,7 @@ static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength)
BIO_printf(bio_err,"Generating temp (%d bit) RSA key...",keylength); BIO_printf(bio_err,"Generating temp (%d bit) RSA key...",keylength);
BIO_flush(bio_err); BIO_flush(bio_err);
} }
#ifndef NO_RSA
rsa_tmp=RSA_generate_key(keylength,RSA_F4,NULL,NULL); rsa_tmp=RSA_generate_key(keylength,RSA_F4,NULL,NULL);
#endif
if (!s_quiet) if (!s_quiet)
{ {
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");
...@@ -1221,3 +1228,4 @@ static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength) ...@@ -1221,3 +1228,4 @@ static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength)
} }
return(rsa_tmp); return(rsa_tmp);
} }
#endif
...@@ -67,6 +67,10 @@ ...@@ -67,6 +67,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if defined(NO_RSA) && !defined(NO_SSL2)
#define NO_SSL2
#endif
#ifdef NO_STDIO #ifdef NO_STDIO
#define APPS_WIN16 #define APPS_WIN16
#endif #endif
......
...@@ -127,10 +127,10 @@ struct tms { ...@@ -127,10 +127,10 @@ struct tms {
#include <openssl/hmac.h> #include <openssl/hmac.h>
#include <openssl/evp.h> #include <openssl/evp.h>
#endif #endif
#ifndef NO_SHA1 #ifndef NO_SHA
#include <openssl/sha.h> #include <openssl/sha.h>
#endif #endif
#ifndef NO_RMD160 #ifndef NO_RIPEMD
#include <openssl/ripemd.h> #include <openssl/ripemd.h>
#endif #endif
#ifndef NO_RC4 #ifndef NO_RC4
...@@ -145,7 +145,7 @@ struct tms { ...@@ -145,7 +145,7 @@ struct tms {
#ifndef NO_IDEA #ifndef NO_IDEA
#include <openssl/idea.h> #include <openssl/idea.h>
#endif #endif
#ifndef NO_BLOWFISH #ifndef NO_BF
#include <openssl/blowfish.h> #include <openssl/blowfish.h>
#endif #endif
#ifndef NO_CAST #ifndef NO_CAST
...@@ -153,9 +153,9 @@ struct tms { ...@@ -153,9 +153,9 @@ struct tms {
#endif #endif
#ifndef NO_RSA #ifndef NO_RSA
#include <openssl/rsa.h> #include <openssl/rsa.h>
#include "./testrsa.h"
#endif #endif
#include <openssl/x509.h> #include <openssl/x509.h>
#include "./testrsa.h"
#ifndef NO_DSA #ifndef NO_DSA
#include "./testdsa.h" #include "./testdsa.h"
#endif #endif
...@@ -261,10 +261,10 @@ int MAIN(int argc, char **argv) ...@@ -261,10 +261,10 @@ int MAIN(int argc, char **argv)
unsigned char md5[MD5_DIGEST_LENGTH]; unsigned char md5[MD5_DIGEST_LENGTH];
unsigned char hmac[MD5_DIGEST_LENGTH]; unsigned char hmac[MD5_DIGEST_LENGTH];
#endif #endif
#ifndef NO_SHA1 #ifndef NO_SHA
unsigned char sha[SHA_DIGEST_LENGTH]; unsigned char sha[SHA_DIGEST_LENGTH];
#endif #endif
#ifndef NO_RMD160 #ifndef NO_RIPEMD
unsigned char rmd160[RIPEMD160_DIGEST_LENGTH]; unsigned char rmd160[RIPEMD160_DIGEST_LENGTH];
#endif #endif
#ifndef NO_RC4 #ifndef NO_RC4
...@@ -279,7 +279,7 @@ int MAIN(int argc, char **argv) ...@@ -279,7 +279,7 @@ int MAIN(int argc, char **argv)
#ifndef NO_IDEA #ifndef NO_IDEA
IDEA_KEY_SCHEDULE idea_ks; IDEA_KEY_SCHEDULE idea_ks;
#endif #endif
#ifndef NO_BLOWFISH #ifndef NO_BF
BF_KEY bf_ks; BF_KEY bf_ks;
#endif #endif
#ifndef NO_CAST #ifndef NO_CAST
...@@ -323,9 +323,9 @@ int MAIN(int argc, char **argv) ...@@ -323,9 +323,9 @@ int MAIN(int argc, char **argv)
#define R_RSA_1024 1 #define R_RSA_1024 1
#define R_RSA_2048 2 #define R_RSA_2048 2
#define R_RSA_4096 3 #define R_RSA_4096 3
#ifndef NO_RSA
RSA *rsa_key[RSA_NUM]; RSA *rsa_key[RSA_NUM];
long rsa_c[RSA_NUM][2]; long rsa_c[RSA_NUM][2];
#ifndef NO_RSA
double rsa_results[RSA_NUM][2]; double rsa_results[RSA_NUM][2];
static unsigned int rsa_bits[RSA_NUM]={512,1024,2048,4096}; static unsigned int rsa_bits[RSA_NUM]={512,1024,2048,4096};
static unsigned char *rsa_data[RSA_NUM]= static unsigned char *rsa_data[RSA_NUM]=
...@@ -346,7 +346,7 @@ int MAIN(int argc, char **argv) ...@@ -346,7 +346,7 @@ int MAIN(int argc, char **argv)
int pr_header=0; int pr_header=0;
apps_startup(); apps_startup();
#ifdef NO_DSA #ifndef NO_DSA
memset(dsa_key,0,sizeof(dsa_key)); memset(dsa_key,0,sizeof(dsa_key));
#endif #endif
...@@ -402,13 +402,13 @@ int MAIN(int argc, char **argv) ...@@ -402,13 +402,13 @@ int MAIN(int argc, char **argv)
if (strcmp(*argv,"hmac") == 0) doit[D_HMAC]=1; if (strcmp(*argv,"hmac") == 0) doit[D_HMAC]=1;
else else
#endif #endif
#ifndef NO_SHA1 #ifndef NO_SHA
if (strcmp(*argv,"sha1") == 0) doit[D_SHA1]=1; if (strcmp(*argv,"sha1") == 0) doit[D_SHA1]=1;
else else
if (strcmp(*argv,"sha") == 0) doit[D_SHA1]=1; if (strcmp(*argv,"sha") == 0) doit[D_SHA1]=1;
else else
#endif #endif
#ifndef NO_RMD160 #ifndef NO_RIPEMD
if (strcmp(*argv,"ripemd") == 0) doit[D_RMD160]=1; if (strcmp(*argv,"ripemd") == 0) doit[D_RMD160]=1;
else else
if (strcmp(*argv,"rmd160") == 0) doit[D_RMD160]=1; if (strcmp(*argv,"rmd160") == 0) doit[D_RMD160]=1;
...@@ -464,7 +464,7 @@ int MAIN(int argc, char **argv) ...@@ -464,7 +464,7 @@ int MAIN(int argc, char **argv)
else if (strcmp(*argv,"idea") == 0) doit[D_CBC_IDEA]=1; else if (strcmp(*argv,"idea") == 0) doit[D_CBC_IDEA]=1;
else else
#endif #endif
#ifndef NO_BLOWFISH #ifndef NO_BF
if (strcmp(*argv,"bf-cbc") == 0) doit[D_CBC_BF]=1; if (strcmp(*argv,"bf-cbc") == 0) doit[D_CBC_BF]=1;
else if (strcmp(*argv,"blowfish") == 0) doit[D_CBC_BF]=1; else if (strcmp(*argv,"blowfish") == 0) doit[D_CBC_BF]=1;
else if (strcmp(*argv,"bf") == 0) doit[D_CBC_BF]=1; else if (strcmp(*argv,"bf") == 0) doit[D_CBC_BF]=1;
...@@ -514,10 +514,10 @@ int MAIN(int argc, char **argv) ...@@ -514,10 +514,10 @@ int MAIN(int argc, char **argv)
#ifndef NO_RC5 #ifndef NO_RC5
BIO_printf(bio_err,"rc5-cbc "); BIO_printf(bio_err,"rc5-cbc ");
#endif #endif
#ifndef NO_BLOWFISH #ifndef NO_BF
BIO_printf(bio_err,"bf-cbc"); BIO_printf(bio_err,"bf-cbc");
#endif #endif
#if !defined(NO_IDEA) && !defined(NO_RC2) && !defined(NO_BLOWFISH) && !defined(NO_RC5) #if !defined(NO_IDEA) && !defined(NO_RC2) && !defined(NO_BF) && !defined(NO_RC5)
BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"\n");
#endif #endif
BIO_printf(bio_err,"des-cbc des-ede3 "); BIO_printf(bio_err,"des-cbc des-ede3 ");
...@@ -601,14 +601,15 @@ int MAIN(int argc, char **argv) ...@@ -601,14 +601,15 @@ int MAIN(int argc, char **argv)
#ifndef NO_RC5 #ifndef NO_RC5
RC5_32_set_key(&rc5_ks,16,key16,12); RC5_32_set_key(&rc5_ks,16,key16,12);
#endif #endif
#ifndef NO_BLOWFISH #ifndef NO_BF
BF_set_key(&bf_ks,16,key16); BF_set_key(&bf_ks,16,key16);
#endif #endif
#ifndef NO_CAST #ifndef NO_CAST
CAST_set_key(&cast_ks,16,key16); CAST_set_key(&cast_ks,16,key16);
#endif #endif
#ifndef NO_RSA
memset(rsa_c,0,sizeof(rsa_c)); memset(rsa_c,0,sizeof(rsa_c));
#endif
#ifndef SIGALRM #ifndef SIGALRM
BIO_printf(bio_err,"First we calculate the approximate speed ...\n"); BIO_printf(bio_err,"First we calculate the approximate speed ...\n");
count=10; count=10;
...@@ -659,6 +660,7 @@ int MAIN(int argc, char **argv) ...@@ -659,6 +660,7 @@ int MAIN(int argc, char **argv)
c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1; c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1;
c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1; c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1;
} }
#ifndef NO_RSA
rsa_c[R_RSA_512][0]=count/2000; rsa_c[R_RSA_512][0]=count/2000;
rsa_c[R_RSA_512][1]=count/400; rsa_c[R_RSA_512][1]=count/400;
for (i=1; i<RSA_NUM; i++) for (i=1; i<RSA_NUM; i++)
...@@ -676,6 +678,7 @@ int MAIN(int argc, char **argv) ...@@ -676,6 +678,7 @@ int MAIN(int argc, char **argv)
} }
} }
} }
#endif
dsa_c[R_DSA_512][0]=count/1000; dsa_c[R_DSA_512][0]=count/1000;
dsa_c[R_DSA_512][1]=count/1000/2; dsa_c[R_DSA_512][1]=count/1000/2;
...@@ -777,7 +780,7 @@ int MAIN(int argc, char **argv) ...@@ -777,7 +780,7 @@ int MAIN(int argc, char **argv)
} }
} }
#endif #endif
#ifndef NO_SHA1 #ifndef NO_SHA
if (doit[D_SHA1]) if (doit[D_SHA1])
{ {
for (j=0; j<SIZE_NUM; j++) for (j=0; j<SIZE_NUM; j++)
...@@ -793,7 +796,7 @@ int MAIN(int argc, char **argv) ...@@ -793,7 +796,7 @@ int MAIN(int argc, char **argv)
} }
} }
#endif #endif
#ifndef NO_RMD160 #ifndef NO_RIPEMD
if (doit[D_RMD160]) if (doit[D_RMD160])
{ {
for (j=0; j<SIZE_NUM; j++) for (j=0; j<SIZE_NUM; j++)
...@@ -914,7 +917,7 @@ int MAIN(int argc, char **argv) ...@@ -914,7 +917,7 @@ int MAIN(int argc, char **argv)
} }
} }
#endif #endif
#ifndef NO_BLOWFISH #ifndef NO_BF
if (doit[D_CBC_BF]) if (doit[D_CBC_BF])
{ {
for (j=0; j<SIZE_NUM; j++) for (j=0; j<SIZE_NUM; j++)
...@@ -1092,7 +1095,7 @@ int MAIN(int argc, char **argv) ...@@ -1092,7 +1095,7 @@ int MAIN(int argc, char **argv)
#ifndef NO_IDEA #ifndef NO_IDEA
printf("%s ",idea_options()); printf("%s ",idea_options());
#endif #endif
#ifndef NO_BLOWFISH #ifndef NO_BF
printf("%s ",BF_options()); printf("%s ",BF_options());
#endif #endif
fprintf(stdout,"\n%s\n",SSLeay_version(SSLEAY_CFLAGS)); fprintf(stdout,"\n%s\n",SSLeay_version(SSLEAY_CFLAGS));
......
...@@ -119,7 +119,7 @@ int MAIN(int argc, char **argv) ...@@ -119,7 +119,7 @@ int MAIN(int argc, char **argv)
#ifndef NO_IDEA #ifndef NO_IDEA
printf("%s ",idea_options()); printf("%s ",idea_options());
#endif #endif
#ifndef NO_BLOWFISH #ifndef NO_BF
printf("%s ",BF_options()); printf("%s ",BF_options());
#endif #endif
printf("\n"); printf("\n");
......
...@@ -115,11 +115,11 @@ lint: ...@@ -115,11 +115,11 @@ lint:
done; done;
depend: depend:
$(MAKEDEPEND) $(INCLUDE) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDE) $(DEPFLAG) $(PROGS) $(LIBSRC)
@for i in $(SDIRS) ;\ @for i in $(SDIRS) ;\
do \ do \
(cd $$i; echo "making depend in crypto/$$i..."; \ (cd $$i; echo "making depend in crypto/$$i..."; \
$(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' depend ); \ $(MAKE) MAKEFILE='${MAKEFILE}' INCLUDES='${INCLUDES}' DEPFLAG='${DEPFLAG}' depend ); \
done; done;
clean: clean:
......
...@@ -101,7 +101,7 @@ lint: ...@@ -101,7 +101,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DH
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -97,4 +98,4 @@ err: ...@@ -97,4 +98,4 @@ err:
if (bs != NULL) ASN1_BIT_STRING_free(bs); if (bs != NULL) ASN1_BIT_STRING_free(bs);
return(NULL); return(NULL);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -90,4 +91,4 @@ err: ...@@ -90,4 +91,4 @@ err:
if (bs != NULL) ASN1_BIT_STRING_free(bs); if (bs != NULL) ASN1_BIT_STRING_free(bs);
return(NULL); return(NULL);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_RSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -117,4 +118,4 @@ err: ...@@ -117,4 +118,4 @@ err:
if (bs != NULL) ASN1_INTEGER_free(bs); if (bs != NULL) ASN1_INTEGER_free(bs);
return(NULL); return(NULL);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_RSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -89,4 +90,4 @@ err: ...@@ -89,4 +90,4 @@ err:
if (bs != NULL) ASN1_INTEGER_free(bs); if (bs != NULL) ASN1_INTEGER_free(bs);
return(NULL); return(NULL);
} }
#endif
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
/* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ /* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
#ifndef NO_DSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -101,4 +102,4 @@ err: ...@@ -101,4 +102,4 @@ err:
if (bs != NULL) ASN1_INTEGER_free(bs); if (bs != NULL) ASN1_INTEGER_free(bs);
return(NULL); return(NULL);
} }
#endif
...@@ -56,8 +56,9 @@ ...@@ -56,8 +56,9 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
/* Origional version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ /* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
#ifndef NO_DSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -113,4 +114,4 @@ err: ...@@ -113,4 +114,4 @@ err:
if (bs != NULL) ASN1_INTEGER_free(bs); if (bs != NULL) ASN1_INTEGER_free(bs);
return(NULL); return(NULL);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DH
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -119,3 +120,4 @@ err: ...@@ -119,3 +120,4 @@ err:
*pp=p; *pp=p;
return(ret); return(ret);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -112,4 +113,5 @@ err: ...@@ -112,4 +113,5 @@ err:
*pp=p; *pp=p;
return(ret); return(ret);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_RSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -122,4 +123,5 @@ int i2d_RSAPrivateKey(RSA *a, unsigned char **pp) ...@@ -122,4 +123,5 @@ int i2d_RSAPrivateKey(RSA *a, unsigned char **pp)
*pp=p; *pp=p;
return(t); return(t);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_RSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -108,4 +109,4 @@ int i2d_RSAPublicKey(RSA *a, unsigned char **pp) ...@@ -108,4 +109,4 @@ int i2d_RSAPublicKey(RSA *a, unsigned char **pp)
*pp=p; *pp=p;
return(t); return(t);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -119,4 +120,4 @@ int i2d_DSAPrivateKey(DSA *a, unsigned char **pp) ...@@ -119,4 +120,4 @@ int i2d_DSAPrivateKey(DSA *a, unsigned char **pp)
*pp=p; *pp=p;
return(t); return(t);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_DSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -124,4 +125,4 @@ int i2d_DSAPublicKey(DSA *a, unsigned char **pp) ...@@ -124,4 +125,4 @@ int i2d_DSAPublicKey(DSA *a, unsigned char **pp)
*pp=p; *pp=p;
return(t); return(t);
} }
#endif
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_RSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/rsa.h> #include <openssl/rsa.h>
...@@ -78,6 +79,7 @@ static int i2d_NETSCAPE_PKEY(NETSCAPE_PKEY *a, unsigned char **pp); ...@@ -78,6 +79,7 @@ static int i2d_NETSCAPE_PKEY(NETSCAPE_PKEY *a, unsigned char **pp);
static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(NETSCAPE_PKEY **a,unsigned char **pp, long length); static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(NETSCAPE_PKEY **a,unsigned char **pp, long length);
static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void); static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void);
static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *); static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *);
int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()) int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)())
{ {
int i,j,l[6]; int i,j,l[6];
...@@ -336,4 +338,4 @@ static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *a) ...@@ -336,4 +338,4 @@ static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *a)
} }
#endif /* NO_RC4 */ #endif /* NO_RC4 */
#endif
...@@ -91,7 +91,7 @@ lint: ...@@ -91,7 +91,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -62,6 +62,14 @@ ...@@ -62,6 +62,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef NO_BF
int main(int argc, char *argv[])
{
printf("No BF support\n");
return(0);
}
#else
#include <openssl/blowfish.h> #include <openssl/blowfish.h>
char *bf_key[2]={ char *bf_key[2]={
...@@ -511,3 +519,4 @@ static int test(void) ...@@ -511,3 +519,4 @@ static int test(void)
return(err); return(err);
} }
#endif
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_BF
#error BF is disabled.
#endif
#define BF_ENCRYPT 1 #define BF_ENCRYPT 1
#define BF_DECRYPT 0 #define BF_DECRYPT 0
......
...@@ -73,7 +73,7 @@ lint: ...@@ -73,7 +73,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -140,7 +140,7 @@ lint: ...@@ -140,7 +140,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -94,7 +94,7 @@ lint: ...@@ -94,7 +94,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_CAST
#error CAST is disabled.
#endif
#define CAST_ENCRYPT 1 #define CAST_ENCRYPT 1
#define CAST_DECRYPT 0 #define CAST_DECRYPT 0
......
...@@ -59,6 +59,14 @@ ...@@ -59,6 +59,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef NO_CAST
int main(int argc, char *argv[])
{
printf("No CAST support\n");
return(0);
}
#else
#include <openssl/cast.h> #include <openssl/cast.h>
#define FULL_TEST #define FULL_TEST
...@@ -219,4 +227,4 @@ int main(int argc, char *argv[]) ...@@ -219,4 +227,4 @@ int main(int argc, char *argv[])
exit(err); exit(err);
return(err); return(err);
} }
#endif
...@@ -68,7 +68,7 @@ lint: ...@@ -68,7 +68,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -66,7 +66,7 @@ lint: ...@@ -66,7 +66,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -123,7 +123,7 @@ lint: ...@@ -123,7 +123,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_DES
#error DES is disabled.
#endif
#include <stdio.h> #include <stdio.h>
#include <openssl/opensslconf.h> /* DES_LONG */ #include <openssl/opensslconf.h> /* DES_LONG */
......
...@@ -70,6 +70,14 @@ ...@@ -70,6 +70,14 @@
#include <io.h> #include <io.h>
#endif #endif
#include <string.h> #include <string.h>
#ifdef NO_DES
int main(int argc, char *argv[])
{
printf("No DES support\n");
return(0);
}
#else
#include <openssl/des.h> #include <openssl/des.h>
#if defined(PERL5) || defined(__FreeBSD__) #if defined(PERL5) || defined(__FreeBSD__)
...@@ -318,6 +326,7 @@ int main(int argc, char *argv[]) ...@@ -318,6 +326,7 @@ int main(int argc, char *argv[])
int num; int num;
char *str; char *str;
#ifndef NO_DESCBCM
printf("Doing cbcm\n"); printf("Doing cbcm\n");
if ((j=des_key_sched(cbc_key,ks)) != 0) if ((j=des_key_sched(cbc_key,ks)) != 0)
{ {
...@@ -368,7 +377,7 @@ int main(int argc, char *argv[]) ...@@ -368,7 +377,7 @@ int main(int argc, char *argv[])
printf("\n"); printf("\n");
err=1; err=1;
} }
#endif
printf("Doing ecb\n"); printf("Doing ecb\n");
for (i=0; i<NUM_TESTS; i++) for (i=0; i<NUM_TESTS; i++)
...@@ -908,4 +917,4 @@ static int ede_cfb64_test(unsigned char *cfb_cipher) ...@@ -908,4 +917,4 @@ static int ede_cfb64_test(unsigned char *cfb_cipher)
} }
#endif #endif
#endif
...@@ -68,6 +68,7 @@ http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-get.cgi/1998/CS/CS0928.ps.gz ...@@ -68,6 +68,7 @@ http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-get.cgi/1998/CS/CS0928.ps.gz
*/ */
#ifndef NO_DESCBCM
#include "des_locl.h" #include "des_locl.h"
void des_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out, void des_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out,
...@@ -192,3 +193,4 @@ void des_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out, ...@@ -192,3 +193,4 @@ void des_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out,
tin0=tin1=tout0=tout1=xor0=xor1=0; tin0=tin1=tout0=tout1=xor0=xor1=0;
tin[0]=tin[1]=0; tin[0]=tin[1]=0;
} }
#endif
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_DH
#error DH is disabled.
#endif
#include <openssl/bn.h> #include <openssl/bn.h>
#define DH_FLAG_CACHE_MONT_P 0x01 #define DH_FLAG_CACHE_MONT_P 0x01
......
...@@ -65,6 +65,14 @@ ...@@ -65,6 +65,14 @@
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include <openssl/bio.h> #include <openssl/bio.h>
#include <openssl/bn.h> #include <openssl/bn.h>
#ifdef NO_DH
int main(int argc, char *argv[])
{
printf("No DH support\n");
return(0);
}
#else
#include <openssl/dh.h> #include <openssl/dh.h>
#ifdef WIN16 #ifdef WIN16
...@@ -177,3 +185,4 @@ static void MS_CALLBACK cb(int p, int n, char *arg) ...@@ -177,3 +185,4 @@ static void MS_CALLBACK cb(int p, int n, char *arg)
p=n; p=n;
#endif #endif
} }
#endif
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -69,6 +69,10 @@ ...@@ -69,6 +69,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_DSA
#error DSA is disabled.
#endif
#include <openssl/bn.h> #include <openssl/bn.h>
#define DSA_FLAG_CACHE_MONT_P 0x01 #define DSA_FLAG_CACHE_MONT_P 0x01
......
...@@ -65,11 +65,19 @@ ...@@ -65,11 +65,19 @@
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/bio.h> #include <openssl/bio.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/dsa.h>
#ifdef WINDOWS #ifdef WINDOWS
#include "../bio/bss_file.c" #include "../bio/bss_file.c"
#endif #endif
#ifdef NO_DSA
int main(int argc, char *argv[])
{
printf("No DSA support\n");
return(0);
}
#else
#include <openssl/dsa.h>
#ifdef WIN16 #ifdef WIN16
#define MS_CALLBACK _far _loadds #define MS_CALLBACK _far _loadds
#else #else
...@@ -206,5 +214,4 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg) ...@@ -206,5 +214,4 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg)
exit(1); exit(1);
} }
} }
#endif
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -92,7 +92,7 @@ lint: ...@@ -92,7 +92,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -69,10 +69,10 @@ extern "C" { ...@@ -69,10 +69,10 @@ extern "C" {
#ifndef NO_MD5 #ifndef NO_MD5
#include <openssl/md5.h> #include <openssl/md5.h>
#endif #endif
#if !defined(NO_SHA) || !defined(NO_SHA1) #ifndef NO_SHA
#include <openssl/sha.h> #include <openssl/sha.h>
#endif #endif
#ifndef NO_RMD160 #ifndef NO_RIPEMD
#include <openssl/ripemd.h> #include <openssl/ripemd.h>
#endif #endif
#ifndef NO_DES #ifndef NO_DES
...@@ -87,7 +87,7 @@ extern "C" { ...@@ -87,7 +87,7 @@ extern "C" {
#ifndef NO_RC5 #ifndef NO_RC5
#include <openssl/rc5.h> #include <openssl/rc5.h>
#endif #endif
#ifndef NO_BLOWFISH #ifndef NO_BF
#include <openssl/blowfish.h> #include <openssl/blowfish.h>
#endif #endif
#ifndef NO_CAST #ifndef NO_CAST
...@@ -111,20 +111,14 @@ extern "C" { ...@@ -111,20 +111,14 @@ extern "C" {
#ifndef NO_RSA #ifndef NO_RSA
#include <openssl/rsa.h> #include <openssl/rsa.h>
#else
#define RSA long
#endif #endif
#ifndef NO_DSA #ifndef NO_DSA
#include <openssl/dsa.h> #include <openssl/dsa.h>
#else
#define DSA long
#endif #endif
#ifndef NO_DH #ifndef NO_DH
#include <openssl/dh.h> #include <openssl/dh.h>
#else
#define DH long
#endif #endif
#include <openssl/objects.h> #include <openssl/objects.h>
...@@ -159,9 +153,15 @@ typedef struct evp_pkey_st ...@@ -159,9 +153,15 @@ typedef struct evp_pkey_st
int references; int references;
union { union {
char *ptr; char *ptr;
#ifndef NO_RSA
struct rsa_st *rsa; /* RSA */ struct rsa_st *rsa; /* RSA */
#endif
#ifndef NO_DSA
struct dsa_st *dsa; /* DSA */ struct dsa_st *dsa; /* DSA */
#endif
#ifndef NO_DH
struct dh_st *dh; /* DH */ struct dh_st *dh; /* DH */
#endif
} pkey; } pkey;
int save_parameters; int save_parameters;
STACK /*X509_ATTRIBUTE*/ *attributes; /* [ 0 ] */ STACK /*X509_ATTRIBUTE*/ *attributes; /* [ 0 ] */
...@@ -294,10 +294,10 @@ typedef struct env_md_ctx_st ...@@ -294,10 +294,10 @@ typedef struct env_md_ctx_st
#ifndef NO_MD5 #ifndef NO_MD5
MD5_CTX md5; MD5_CTX md5;
#endif #endif
#ifndef NO_RMD160 #ifndef NO_RIPEMD
RIPEMD160_CTX ripemd160; RIPEMD160_CTX ripemd160;
#endif #endif
#if !defined(NO_SHA) || !defined(NO_SHA1) #ifndef NO_SHA
SHA_CTX sha; SHA_CTX sha;
#endif #endif
#ifndef NO_MDC2 #ifndef NO_MDC2
...@@ -372,7 +372,7 @@ typedef struct evp_cipher_ctx_st ...@@ -372,7 +372,7 @@ typedef struct evp_cipher_ctx_st
#ifndef NO_RC5 #ifndef NO_RC5
RC5_32_KEY rc5_ks;/* key schedule */ RC5_32_KEY rc5_ks;/* key schedule */
#endif #endif
#ifndef NO_BLOWFISH #ifndef NO_BF
BF_KEY bf_ks;/* key schedule */ BF_KEY bf_ks;/* key schedule */
#endif #endif
#ifndef NO_CAST #ifndef NO_CAST
......
...@@ -67,14 +67,19 @@ ...@@ -67,14 +67,19 @@
EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
{ {
EVP_PKEY *pkey; EVP_PKEY *pkey;
#ifndef NO_RSA
RSA *rsa; RSA *rsa;
#endif
#ifndef NO_DSA
DSA *dsa; DSA *dsa;
ASN1_INTEGER *dsapriv; ASN1_INTEGER *dsapriv;
X509_ALGOR *a;
STACK *ndsa; STACK *ndsa;
BN_CTX *ctx; BN_CTX *ctx;
int plen;
#endif
X509_ALGOR *a;
unsigned char *p; unsigned char *p;
int plen, pkeylen; int pkeylen;
char obj_tmp[80]; char obj_tmp[80];
switch (p8->broken) { switch (p8->broken) {
...@@ -100,6 +105,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) ...@@ -100,6 +105,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
a = p8->pkeyalg; a = p8->pkeyalg;
switch (OBJ_obj2nid(a->algorithm)) switch (OBJ_obj2nid(a->algorithm))
{ {
#ifndef NO_RSA
case NID_rsaEncryption: case NID_rsaEncryption:
if (!(rsa = d2i_RSAPrivateKey (NULL, &p, pkeylen))) { if (!(rsa = d2i_RSAPrivateKey (NULL, &p, pkeylen))) {
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
...@@ -107,7 +113,8 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) ...@@ -107,7 +113,8 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
} }
EVP_PKEY_assign_RSA (pkey, rsa); EVP_PKEY_assign_RSA (pkey, rsa);
break; break;
#endif
#ifndef NO_DSA
case NID_dsa: case NID_dsa:
/* PKCS#8 DSA is weird: you just get a private key integer /* PKCS#8 DSA is weird: you just get a private key integer
* and parameters in the AlgorithmIdentifier the pubkey must * and parameters in the AlgorithmIdentifier the pubkey must
...@@ -174,7 +181,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) ...@@ -174,7 +181,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
EVP_PKEY_assign_DSA (pkey, dsa); EVP_PKEY_assign_DSA (pkey, dsa);
BN_CTX_free (ctx); BN_CTX_free (ctx);
break; break;
#endif
default: default:
EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM); EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
if (!a->algorithm) strcpy (obj_tmp, "NULL"); if (!a->algorithm) strcpy (obj_tmp, "NULL");
...@@ -191,9 +198,11 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) ...@@ -191,9 +198,11 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey)
{ {
PKCS8_PRIV_KEY_INFO *p8; PKCS8_PRIV_KEY_INFO *p8;
#ifndef NO_DSA
ASN1_INTEGER *dpkey; ASN1_INTEGER *dpkey;
unsigned char *p, *q; unsigned char *p, *q;
int len; int len;
#endif
if (!(p8 = PKCS8_PRIV_KEY_INFO_new())) { if (!(p8 = PKCS8_PRIV_KEY_INFO_new())) {
EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
...@@ -205,6 +214,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) ...@@ -205,6 +214,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey)
return NULL; return NULL;
} }
switch (EVP_PKEY_type(pkey->type)) { switch (EVP_PKEY_type(pkey->type)) {
#ifndef NO_RSA
case EVP_PKEY_RSA: case EVP_PKEY_RSA:
p8->pkeyalg->algorithm = OBJ_nid2obj(NID_rsaEncryption); p8->pkeyalg->algorithm = OBJ_nid2obj(NID_rsaEncryption);
...@@ -216,7 +226,8 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) ...@@ -216,7 +226,8 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey)
return NULL; return NULL;
} }
break; break;
#endif
#ifndef NO_DSA
case EVP_PKEY_DSA: case EVP_PKEY_DSA:
p8->pkeyalg->algorithm = OBJ_nid2obj(NID_dsa); p8->pkeyalg->algorithm = OBJ_nid2obj(NID_dsa);
...@@ -249,7 +260,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) ...@@ -249,7 +260,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey)
} }
ASN1_INTEGER_free (dpkey); ASN1_INTEGER_free (dpkey);
break; break;
#endif
default: default:
EVPerr(EVP_F_EVP_PKEY2PKCS8, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM); EVPerr(EVP_F_EVP_PKEY2PKCS8, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM);
PKCS8_PRIV_KEY_INFO_free (p8); PKCS8_PRIV_KEY_INFO_free (p8);
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_RSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/evp.h> #include <openssl/evp.h>
...@@ -109,3 +110,4 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) ...@@ -109,3 +110,4 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
EVP_DecryptInit(ctx,NULL,NULL,NULL); EVP_DecryptInit(ctx,NULL,NULL,NULL);
return(i); return(i);
} }
#endif
...@@ -59,7 +59,9 @@ ...@@ -59,7 +59,9 @@
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/rand.h> #include <openssl/rand.h>
#ifndef NO_RSA
#include <openssl/rsa.h> #include <openssl/rsa.h>
#endif
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/objects.h> #include <openssl/objects.h>
#include <openssl/x509.h> #include <openssl/x509.h>
......
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -62,6 +62,10 @@ ...@@ -62,6 +62,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_HMAC
#error No HMAC support.
#endif
#include <openssl/evp.h> #include <openssl/evp.h>
#define HMAC_MAX_MD_CBLOCK 64 #define HMAC_MAX_MD_CBLOCK 64
......
...@@ -59,6 +59,14 @@ ...@@ -59,6 +59,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef NO_HMAC
int main(int argc, char *argv[])
{
printf("No HMAC support\n");
return(0);
}
#else
#include <openssl/hmac.h> #include <openssl/hmac.h>
struct test_st struct test_st
...@@ -137,3 +145,4 @@ static char *pt(unsigned char *md) ...@@ -137,3 +145,4 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i*2]),"%02x",md[i]); sprintf(&(buf[i*2]),"%02x",md[i]);
return(buf); return(buf);
} }
#endif
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_IDEA
#error IDEA is disabled.
#endif
#define IDEA_ENCRYPT 1 #define IDEA_ENCRYPT 1
#define IDEA_DECRYPT 0 #define IDEA_DECRYPT 0
......
...@@ -59,6 +59,14 @@ ...@@ -59,6 +59,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef NO_IDEA
int main(int argc, char *argv[])
{
printf("No IDEA support\n");
return(0);
}
#else
#include <openssl/idea.h> #include <openssl/idea.h>
unsigned char k[16]={ unsigned char k[16]={
...@@ -219,4 +227,4 @@ static char *pt(unsigned char *p) ...@@ -219,4 +227,4 @@ static char *pt(unsigned char *p)
ret[16]='\0'; ret[16]='\0';
return(ret); return(ret);
} }
#endif
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_MD2
#error MD2 is disabled.
#endif
#define MD2_DIGEST_LENGTH 16 #define MD2_DIGEST_LENGTH 16
#define MD2_BLOCK 16 #define MD2_BLOCK 16
#include <openssl/opensslconf.h> /* MD2_INT */ #include <openssl/opensslconf.h> /* MD2_INT */
......
...@@ -59,6 +59,14 @@ ...@@ -59,6 +59,14 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef NO_MD2
int main(int argc, char *argv[])
{
printf("No MD2 support\n");
return(0);
}
#else
#include <openssl/md2.h> #include <openssl/md2.h>
char *test[]={ char *test[]={
...@@ -120,3 +128,4 @@ static char *pt(unsigned char *md) ...@@ -120,3 +128,4 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i*2]),"%02x",md[i]); sprintf(&(buf[i*2]),"%02x",md[i]);
return(buf); return(buf);
} }
#endif
...@@ -89,7 +89,7 @@ lint: ...@@ -89,7 +89,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_MD5
#error MD5 is disabled.
#endif
#define MD5_CBLOCK 64 #define MD5_CBLOCK 64
#define MD5_LBLOCK 16 #define MD5_LBLOCK 16
#define MD5_BLOCK 16 #define MD5_BLOCK 16
......
...@@ -59,6 +59,14 @@ ...@@ -59,6 +59,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef NO_MD5
int main(int argc, char *argv[])
{
printf("No MD5 support\n");
return(0);
}
#else
#include <openssl/md5.h> #include <openssl/md5.h>
char *test[]={ char *test[]={
...@@ -120,3 +128,4 @@ static char *pt(unsigned char *md) ...@@ -120,3 +128,4 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i*2]),"%02x",md[i]); sprintf(&(buf[i*2]),"%02x",md[i]);
return(buf); return(buf);
} }
#endif
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -65,6 +65,10 @@ extern "C" { ...@@ -65,6 +65,10 @@ extern "C" {
#include <openssl/des.h> #include <openssl/des.h>
#ifdef NO_MDC2
#error MDC2 is disabled.
#endif
#define MDC2_BLOCK 8 #define MDC2_BLOCK 8
#define MDC2_DIGEST_LENGTH 16 #define MDC2_DIGEST_LENGTH 16
......
...@@ -59,6 +59,18 @@ ...@@ -59,6 +59,18 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef NO_DES
#define NO_MDC2
#endif
#ifdef NO_MDC2
int main(int argc, char *argv[])
{
printf("No MDC2 support\n");
return(0);
}
#else
#include <openssl/mdc2.h> #include <openssl/mdc2.h>
static unsigned char pad1[16]={ static unsigned char pad1[16]={
...@@ -117,4 +129,4 @@ int main(int argc, char *argv[]) ...@@ -117,4 +129,4 @@ int main(int argc, char *argv[])
exit(ret); exit(ret);
return(ret); return(ret);
} }
#endif
...@@ -68,7 +68,7 @@ lint: ...@@ -68,7 +68,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -761,8 +761,8 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={ ...@@ -761,8 +761,8 @@ static ASN1_OBJECT *obj_objs[NUM_OBJ]={
&(nid_objs[19]),/* OBJ_rsa 2 5 8 1 1 */ &(nid_objs[19]),/* OBJ_rsa 2 5 8 1 1 */
&(nid_objs[96]),/* OBJ_mdc2WithRSA 2 5 8 3 100 */ &(nid_objs[96]),/* OBJ_mdc2WithRSA 2 5 8 3 100 */
&(nid_objs[95]),/* OBJ_mdc2 2 5 8 3 101 */ &(nid_objs[95]),/* OBJ_mdc2 2 5 8 3 101 */
&(nid_objs[125]),/* OBJ_zlib_compression 1 1 1 1 666.2 */
&(nid_objs[124]),/* OBJ_rle_compression 1 1 1 1 666.1 */ &(nid_objs[124]),/* OBJ_rle_compression 1 1 1 1 666.1 */
&(nid_objs[125]),/* OBJ_zlib_compression 1 1 1 1 666.2 */
&(nid_objs[104]),/* OBJ_md5WithRSA 1 3 14 3 2 3 */ &(nid_objs[104]),/* OBJ_md5WithRSA 1 3 14 3 2 3 */
&(nid_objs[29]),/* OBJ_des_ecb 1 3 14 3 2 6 */ &(nid_objs[29]),/* OBJ_des_ecb 1 3 14 3 2 6 */
&(nid_objs[31]),/* OBJ_des_cbc 1 3 14 3 2 7 */ &(nid_objs[31]),/* OBJ_des_cbc 1 3 14 3 2 7 */
......
...@@ -66,7 +66,7 @@ lint: ...@@ -66,7 +66,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -372,28 +372,42 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str); ...@@ -372,28 +372,42 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str);
X509 *PEM_read_X509(FILE *fp,X509 **x,int (*cb)()); X509 *PEM_read_X509(FILE *fp,X509 **x,int (*cb)());
X509_REQ *PEM_read_X509_REQ(FILE *fp,X509_REQ **x,int (*cb)()); X509_REQ *PEM_read_X509_REQ(FILE *fp,X509_REQ **x,int (*cb)());
X509_CRL *PEM_read_X509_CRL(FILE *fp,X509_CRL **x,int (*cb)()); X509_CRL *PEM_read_X509_CRL(FILE *fp,X509_CRL **x,int (*cb)());
#ifndef NO_RSA
RSA *PEM_read_RSAPrivateKey(FILE *fp,RSA **x,int (*cb)()); RSA *PEM_read_RSAPrivateKey(FILE *fp,RSA **x,int (*cb)());
RSA *PEM_read_RSAPublicKey(FILE *fp,RSA **x,int (*cb)()); RSA *PEM_read_RSAPublicKey(FILE *fp,RSA **x,int (*cb)());
#endif
#ifndef NO_DSA
DSA *PEM_read_DSAPrivateKey(FILE *fp,DSA **x,int (*cb)()); DSA *PEM_read_DSAPrivateKey(FILE *fp,DSA **x,int (*cb)());
DSA *PEM_read_DSAparams(FILE *fp,DSA **x,int (*cb)());
#endif
#ifndef NO_DH
DH *PEM_read_DHparams(FILE *fp,DH **x,int (*cb)());
#endif
EVP_PKEY *PEM_read_PrivateKey(FILE *fp,EVP_PKEY **x,int (*cb)()); EVP_PKEY *PEM_read_PrivateKey(FILE *fp,EVP_PKEY **x,int (*cb)());
PKCS7 *PEM_read_PKCS7(FILE *fp,PKCS7 **x,int (*cb)()); PKCS7 *PEM_read_PKCS7(FILE *fp,PKCS7 **x,int (*cb)());
DH *PEM_read_DHparams(FILE *fp,DH **x,int (*cb)());
DSA *PEM_read_DSAparams(FILE *fp,DSA **x,int (*cb)());
NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE **x,int (*cb)()); NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE **x,int (*cb)());
int PEM_write_X509(FILE *fp,X509 *x); int PEM_write_X509(FILE *fp,X509 *x);
int PEM_write_X509_REQ(FILE *fp,X509_REQ *x); int PEM_write_X509_REQ(FILE *fp,X509_REQ *x);
int PEM_write_X509_CRL(FILE *fp,X509_CRL *x); int PEM_write_X509_CRL(FILE *fp,X509_CRL *x);
#ifndef NO_RSA
int PEM_write_RSAPrivateKey(FILE *fp,RSA *x,EVP_CIPHER *enc,unsigned char *kstr, int PEM_write_RSAPrivateKey(FILE *fp,RSA *x,EVP_CIPHER *enc,unsigned char *kstr,
int klen,int (*cb)()); int klen,int (*cb)());
int PEM_write_RSAPublicKey(FILE *fp,RSA *x); int PEM_write_RSAPublicKey(FILE *fp,RSA *x);
#endif
#ifndef NO_DSA
int PEM_write_DSAPrivateKey(FILE *fp,DSA *x,const EVP_CIPHER *enc, int PEM_write_DSAPrivateKey(FILE *fp,DSA *x,const EVP_CIPHER *enc,
unsigned char *kstr, unsigned char *kstr,
int klen,int (*cb)()); int klen,int (*cb)());
#endif
int PEM_write_PrivateKey(FILE *fp,EVP_PKEY *x,EVP_CIPHER *enc, int PEM_write_PrivateKey(FILE *fp,EVP_PKEY *x,EVP_CIPHER *enc,
unsigned char *kstr,int klen,int (*cb)()); unsigned char *kstr,int klen,int (*cb)());
int PEM_write_PKCS7(FILE *fp,PKCS7 *x); int PEM_write_PKCS7(FILE *fp,PKCS7 *x);
#ifndef NO_DH
int PEM_write_DHparams(FILE *fp,DH *x); int PEM_write_DHparams(FILE *fp,DH *x);
#endif
#ifndef NO_DSA
int PEM_write_DSAparams(FILE *fp,DSA *x); int PEM_write_DSAparams(FILE *fp,DSA *x);
#endif
int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE *x); int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE *x);
#endif #endif
...@@ -401,27 +415,43 @@ int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE *x); ...@@ -401,27 +415,43 @@ int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE *x);
X509 *PEM_read_bio_X509(BIO *bp,X509 **x,int (*cb)()); X509 *PEM_read_bio_X509(BIO *bp,X509 **x,int (*cb)());
X509_REQ *PEM_read_bio_X509_REQ(BIO *bp,X509_REQ **x,int (*cb)()); X509_REQ *PEM_read_bio_X509_REQ(BIO *bp,X509_REQ **x,int (*cb)());
X509_CRL *PEM_read_bio_X509_CRL(BIO *bp,X509_CRL **x,int (*cb)()); X509_CRL *PEM_read_bio_X509_CRL(BIO *bp,X509_CRL **x,int (*cb)());
#ifndef NO_RSA
RSA *PEM_read_bio_RSAPrivateKey(BIO *bp,RSA **x,int (*cb)()); RSA *PEM_read_bio_RSAPrivateKey(BIO *bp,RSA **x,int (*cb)());
RSA *PEM_read_bio_RSAPublicKey(BIO *bp,RSA **x,int (*cb)()); RSA *PEM_read_bio_RSAPublicKey(BIO *bp,RSA **x,int (*cb)());
#endif
#ifndef NO_DSA
DSA *PEM_read_bio_DSAPrivateKey(BIO *bp,DSA **x,int (*cb)()); DSA *PEM_read_bio_DSAPrivateKey(BIO *bp,DSA **x,int (*cb)());
#endif
EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp,EVP_PKEY **x,int (*cb)()); EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp,EVP_PKEY **x,int (*cb)());
PKCS7 *PEM_read_bio_PKCS7(BIO *bp,PKCS7 **x,int (*cb)()); PKCS7 *PEM_read_bio_PKCS7(BIO *bp,PKCS7 **x,int (*cb)());
#ifndef NO_DH
DH *PEM_read_bio_DHparams(BIO *bp,DH **x,int (*cb)()); DH *PEM_read_bio_DHparams(BIO *bp,DH **x,int (*cb)());
#endif
NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,NETSCAPE_CERT_SEQUENCE **x,int (*cb)()); NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,NETSCAPE_CERT_SEQUENCE **x,int (*cb)());
#ifndef NO_DSA
DSA *PEM_read_bio_DSAparams(BIO *bp,DSA **x,int (*cb)()); DSA *PEM_read_bio_DSAparams(BIO *bp,DSA **x,int (*cb)());
#endif
int PEM_write_bio_X509(BIO *bp,X509 *x); int PEM_write_bio_X509(BIO *bp,X509 *x);
int PEM_write_bio_X509_REQ(BIO *bp,X509_REQ *x); int PEM_write_bio_X509_REQ(BIO *bp,X509_REQ *x);
int PEM_write_bio_X509_CRL(BIO *bp,X509_CRL *x); int PEM_write_bio_X509_CRL(BIO *bp,X509_CRL *x);
#ifndef NO_RSA
int PEM_write_bio_RSAPrivateKey(BIO *fp,RSA *x,const EVP_CIPHER *enc, int PEM_write_bio_RSAPrivateKey(BIO *fp,RSA *x,const EVP_CIPHER *enc,
unsigned char *kstr,int klen,int (*cb)()); unsigned char *kstr,int klen,int (*cb)());
int PEM_write_bio_RSAPublicKey(BIO *fp,RSA *x); int PEM_write_bio_RSAPublicKey(BIO *fp,RSA *x);
#endif
#ifndef NO_DSA
int PEM_write_bio_DSAPrivateKey(BIO *fp,DSA *x,const EVP_CIPHER *enc, int PEM_write_bio_DSAPrivateKey(BIO *fp,DSA *x,const EVP_CIPHER *enc,
unsigned char *kstr,int klen,int (*cb)()); unsigned char *kstr,int klen,int (*cb)());
#endif
int PEM_write_bio_PrivateKey(BIO *fp,EVP_PKEY *x,EVP_CIPHER *enc, int PEM_write_bio_PrivateKey(BIO *fp,EVP_PKEY *x,EVP_CIPHER *enc,
unsigned char *kstr,int klen,int (*cb)()); unsigned char *kstr,int klen,int (*cb)());
int PEM_write_bio_PKCS7(BIO *bp,PKCS7 *x); int PEM_write_bio_PKCS7(BIO *bp,PKCS7 *x);
#ifndef NO_DH
int PEM_write_bio_DHparams(BIO *bp,DH *x); int PEM_write_bio_DHparams(BIO *bp,DH *x);
#endif
#ifndef NO_DSA
int PEM_write_bio_DSAparams(BIO *bp,DSA *x); int PEM_write_bio_DSAparams(BIO *bp,DSA *x);
#endif
int PEM_write_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,NETSCAPE_CERT_SEQUENCE *x); int PEM_write_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,NETSCAPE_CERT_SEQUENCE *x);
#endif #endif
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
* [including the GNU Public Licence.] * [including the GNU Public Licence.]
*/ */
#ifndef NO_RSA
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <openssl/evp.h> #include <openssl/evp.h>
...@@ -174,3 +175,4 @@ err: ...@@ -174,3 +175,4 @@ err:
if (s != NULL) Free(s); if (s != NULL) Free(s);
return(ret); return(ret);
} }
#endif
...@@ -71,7 +71,7 @@ lint: ...@@ -71,7 +71,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -64,18 +64,22 @@ ...@@ -64,18 +64,22 @@
void PKCS12_PBE_add(void) void PKCS12_PBE_add(void)
{ {
#ifndef NO_RC4
EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC4, EVP_rc4(), EVP_sha1(), EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC4, EVP_rc4(), EVP_sha1(),
PKCS12_PBE_keyivgen); PKCS12_PBE_keyivgen);
EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC4, EVP_rc4_40(), EVP_sha1(), EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC4, EVP_rc4_40(), EVP_sha1(),
PKCS12_PBE_keyivgen); PKCS12_PBE_keyivgen);
#endif
EVP_PBE_alg_add(NID_pbe_WithSHA1And3_Key_TripleDES_CBC, EVP_PBE_alg_add(NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
EVP_des_ede3_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); EVP_des_ede3_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen);
EVP_PBE_alg_add(NID_pbe_WithSHA1And2_Key_TripleDES_CBC, EVP_PBE_alg_add(NID_pbe_WithSHA1And2_Key_TripleDES_CBC,
EVP_des_ede_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); EVP_des_ede_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen);
#ifndef NO_RC2
EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC2_CBC, EVP_rc2_cbc(), EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC2_CBC, EVP_rc2_cbc(),
EVP_sha1(), PKCS12_PBE_keyivgen); EVP_sha1(), PKCS12_PBE_keyivgen);
EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(), EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(),
EVP_sha1(), PKCS12_PBE_keyivgen); EVP_sha1(), PKCS12_PBE_keyivgen);
#endif
} }
int PKCS12_PBE_keyivgen (const char *pass, int passlen, unsigned char *salt, int PKCS12_PBE_keyivgen (const char *pass, int passlen, unsigned char *salt,
......
...@@ -67,7 +67,7 @@ lint: ...@@ -67,7 +67,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -65,7 +65,7 @@ lint: ...@@ -65,7 +65,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_RC2
#error RC2 is disabled.
#endif
#define RC2_ENCRYPT 1 #define RC2_ENCRYPT 1
#define RC2_DECRYPT 0 #define RC2_DECRYPT 0
......
...@@ -62,6 +62,14 @@ ...@@ -62,6 +62,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef NO_RC2
int main(int argc, char *argv[])
{
printf("No RC2 support\n");
return(0);
}
#else
#include <openssl/rc2.h> #include <openssl/rc2.h>
unsigned char RC2key[4][16]={ unsigned char RC2key[4][16]={
...@@ -258,3 +266,4 @@ static char *pt(unsigned char *p) ...@@ -258,3 +266,4 @@ static char *pt(unsigned char *p)
} }
#endif #endif
#endif
...@@ -93,7 +93,7 @@ lint: ...@@ -93,7 +93,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_RC4
#error RC4 is disabled.
#endif
#include <openssl/opensslconf.h> /* RC4_INT */ #include <openssl/opensslconf.h> /* RC4_INT */
typedef struct rc4_key_st typedef struct rc4_key_st
......
...@@ -59,6 +59,14 @@ ...@@ -59,6 +59,14 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef NO_RC4
int main(int argc, char *argv[])
{
printf("No RC4 support\n");
return(0);
}
#else
#include <openssl/rc4.h> #include <openssl/rc4.h>
unsigned char keys[7][30]={ unsigned char keys[7][30]={
...@@ -190,4 +198,4 @@ int main(int argc, char *argv[]) ...@@ -190,4 +198,4 @@ int main(int argc, char *argv[])
exit(err); exit(err);
return(0); return(0);
} }
#endif
...@@ -91,7 +91,7 @@ lint: ...@@ -91,7 +91,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_RC5
#error RC5 is disabled.
#endif
#define RC5_ENCRYPT 1 #define RC5_ENCRYPT 1
#define RC5_DECRYPT 0 #define RC5_DECRYPT 0
......
...@@ -62,6 +62,14 @@ ...@@ -62,6 +62,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef NO_RC5
int main(int argc, char *argv[])
{
printf("No RC5 support\n");
return(0);
}
#else
#include <openssl/rc5.h> #include <openssl/rc5.h>
unsigned char RC5key[5][16]={ unsigned char RC5key[5][16]={
...@@ -373,3 +381,4 @@ static char *pt(unsigned char *p) ...@@ -373,3 +381,4 @@ static char *pt(unsigned char *p)
} }
#endif #endif
#endif
...@@ -89,7 +89,7 @@ lint: ...@@ -89,7 +89,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
...@@ -63,6 +63,10 @@ ...@@ -63,6 +63,10 @@
extern "C" { extern "C" {
#endif #endif
#ifdef NO_RIPEMD
#error RIPEMD is disabled.
#endif
#define RIPEMD160_CBLOCK 64 #define RIPEMD160_CBLOCK 64
#define RIPEMD160_LBLOCK 16 #define RIPEMD160_LBLOCK 16
#define RIPEMD160_BLOCK 16 #define RIPEMD160_BLOCK 16
......
...@@ -59,6 +59,14 @@ ...@@ -59,6 +59,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef NO_RIPEMD
int main(int argc, char *argv[])
{
printf("No ripemd support\n");
return(0);
}
#else
#include <openssl/ripemd.h> #include <openssl/ripemd.h>
char *test[]={ char *test[]={
...@@ -122,4 +130,4 @@ static char *pt(unsigned char *md) ...@@ -122,4 +130,4 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i*2]),"%02x",md[i]); sprintf(&(buf[i*2]),"%02x",md[i]);
return(buf); return(buf);
} }
#endif
...@@ -67,7 +67,7 @@ lint: ...@@ -67,7 +67,7 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff lint -DLINT $(INCLUDES) $(SRC)>fluff
depend: depend:
$(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC) $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册