Commit 7f458a48 authored by clucey's avatar clucey Committed by Matt Caswell
Browse files

ALG: Add AFALG engine

parent b63447c1
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1175,6 +1175,19 @@ else { $no_user_defines=1; }

# ALL MODIFICATIONS TO %config and %target MUST BE DONE FROM HERE ON

$config{afalg}="";
if ($target =~ m/^linux/) {
    my $minver = 4*10000 + 1*100 + 0;
    if ($config{cross_compile_prefix} eq "") {
        my $verstr = `uname -r`;
        my ($ma, $mi1, $mi2) = split("\\.", $verstr);
        ($mi2) = $mi2 =~ /(\d+)/;
        my $ver = $ma*10000 + $mi1*100 + $mi2;
        $config{afalg}="afalg" if ($ver >= $minver);
    }
}
push @{$config{engdirs}}, $config{afalg};

# If we use the unified build, collect information from build.info files
my %unified_info = ();

+3 −0
Original line number Diff line number Diff line
@@ -230,6 +230,8 @@ INSTALLDIRS= \
		$(DESTDIR)$(OPENSSLDIR)/certs \
		$(DESTDIR)$(OPENSSLDIR)/private

ENGDIRS={- join(" ", @{$config{engdirs}}) -}

all: Makefile build_all_but_tests

# as we stick to -e, CLEARENV ensures that local variables in lower
@@ -275,6 +277,7 @@ BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
		AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)'	\
		BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)'	\
		RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)'	\
		ENGDIRS='$(ENGDIRS)'    \
		SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)'			\
		MD5_ASM_OBJ='$(MD5_ASM_OBJ)'			\
		RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)'		\
+12 −1
Original line number Diff line number Diff line
@@ -10,6 +10,11 @@ CFLAG=-g
MAKEFILE=	Makefile
AR=		ar r

RECURSIVE_MAKE=	[ -z "$(ENGDIRS)" ] || for i in $(ENGDIRS) ; do \
		    (cd $$i && echo "making $$target in $(DIR)/$$i..." && \
		    $(MAKE) -e TOP=../.. DIR=$$i $$target ) || exit 1; \
		done;

PADLOCK_ASM_OBJ=

PLIB_LDFLAG=
@@ -49,7 +54,7 @@ ALL= $(GENERAL) $(SRC) $(HEADER)
top:
	(cd ..; $(MAKE) DIRS=$(DIR) all)

all:	lib
all:	lib subdirs

lib:	$(LIBOBJ) $(TESTLIBOBJ)
	@if [ "$(DYNAMIC_ENGINES)" = 1 ]; then \
@@ -71,8 +76,12 @@ e_padlock-x86.s: asm/e_padlock-x86.pl
e_padlock-x86_64.s:	asm/e_padlock-x86_64.pl
	$(PERL) asm/e_padlock-x86_64.pl $(PERLASM_SCHEME) > $@

subdirs:
	@target=all; $(RECURSIVE_MAKE)

files:
	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
	@target=files; $(RECURSIVE_MAKE)

install:
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
@@ -94,6 +103,7 @@ uninstall:
			$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT); \
		done; \
	fi
	@target=install; $(RECURSIVE_MAKE)

errors:
	set -e; for l in $(LIBNAMES); do \
@@ -107,5 +117,6 @@ depend:

clean:
	rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
	@target=clean; $(RECURSIVE_MAKE)

# DO NOT DELETE THIS LINE -- make depend depends on it.
+89 −0
Original line number Diff line number Diff line
#
# OpenSSL/engines/afalg/Makefile
#

DIR=	afalg
TOP=	../..
CC=	cc
INCLUDES= -I../../include
CFLAG=-g
MAKEFILE=	Makefile
AR=		ar r

CFLAGS= $(INCLUDES) $(CFLAG)
LIB=$(TOP)/libcrypto.a

LIBNAME=afalg
LIBSRC=	e_afalg.c
LIBOBJ=	e_afalg.o e_afalg_err.o

SRC= $(LIBSRC)

top:
	(cd $(TOP); $(MAKE) DIRS=engines sub_all)

all: errors lib

errors:
	$(PERL) $(TOP)/util/mkerr.pl -conf e_afalg.ec -nostatic -write $(SRC)

lib: $(LIBOBJ)
	@if [ -n "$(SHARED_LIBS)" ]; then \
		$(MAKE) -f $(TOP)/Makefile.shared -e \
			LIBNAME=$(LIBNAME) \
			LIBEXTRAS='$(LIBOBJ)' \
			LIBDEPS='-L$(TOP) -lcrypto' \
			link_o.$(SHLIB_TARGET); \
	else \
		$(AR) $(LIB) $(LIBOBJ); \
	fi
	@touch lib

install:
	[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
	if [ -n "$(SHARED_LIBS)" ]; then \
		set -e; \
		echo installing $(LIBNAME); \
		pfx=lib; \
		if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
			sfx=".so"; \
			cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
		else \
			case "$(CFLAGS)" in \
			*DSO_DLFCN*) sfx=`expr "$(SHLIB_EXT)" : '.*\(\.[a-z][a-z]*\)' \| ".so"`;; \
			*DSO_DL*) sfx=".sl";; \
			*DSO_WIN32*) sfx="eay32.dll"; pfx=;; \
			*) sfx=".bad";; \
			esac; \
			cp $${pfx}$(LIBNAME)$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
		fi; \
		chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
		mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx; \
	fi

depend: 
	@[ -z "$(THIS)" ] || $(TOP)/util/domd $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) $(TESTLIBSRC)

files:
	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO

clean:
	rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff *.so *.dll *.dylib

# DO NOT DELETE THIS LINE -- make depend depends on it.
e_afalg.o: e_afalg.c ../../include/openssl/engine.h \
 ../../include/openssl/opensslconf.h ../../include/openssl/bn.h \
 ../../include/openssl/e_os2.h ../../include/openssl/ossl_typ.h \
 ../../include/openssl/crypto.h ../../include/openssl/stack.h \
 ../../include/openssl/safestack.h ../../include/openssl/opensslv.h \
 ../../include/openssl/symhacks.h ../../include/openssl/rsa.h \
 ../../include/openssl/asn1.h ../../include/openssl/bio.h \
 ../../include/openssl/dsa.h ../../include/openssl/dh.h \
 ../../include/openssl/ec.h ../../include/openssl/rand.h \
 ../../include/openssl/ui.h ../../include/openssl/err.h \
 ../../include/openssl/lhash.h ../../include/openssl/x509.h \
 ../../include/openssl/buffer.h ../../include/openssl/evp.h \
 ../../include/openssl/objects.h ../../include/openssl/obj_mac.h \
 ../../include/openssl/sha.h ../../include/openssl/x509_vfy.h \
 ../../include/openssl/pkcs7.h ../../include/openssl/async.h e_afalg.h \
 e_afalg_err.h
+8 −0
Original line number Diff line number Diff line
{- use File::Spec::Functions qw/:DEFAULT rel2abs/; -}

IF[{- $config{afalg} eq "afalg" -}] 
 ENGINES=libafalg
 SOURCE[libafalg]=e_afalg.c e_afalg_err.c
 DEPEND[libafalg]=../../libcrypto
 INCLUDE[libafalg]= {- rel2abs(catdir($builddir,"../include")) -} ../../include
ENDIF
Loading