libsa: Move hash functions up a level

This should have no functional change. Move compiling the sha256, sha512
and md5 hash functions up into libsa to allow them to be used elsewhere
in the boot loader when geli isn't configured. Since libsa is a .a, these
won't wind up in any boot loader that doesn't reference them, so should
be a nop.

Sponsored by:		Netflix

(cherry picked from commit fd577b59b2d78a32f40fdc3847666728d8a897db)
This commit is contained in:
Warner Losh 2024-01-31 16:54:19 -07:00
parent 6d41d985fd
commit 12138b85bb
2 changed files with 9 additions and 11 deletions

View file

@ -180,6 +180,15 @@ SRCS+= explicit_bzero.c crc32_libkern.c
.include "${SASRC}/zfs/Makefile.inc"
.endif
# Crypto hashing functions
# sha256 and sha512 from sys/crypto
.PATH: ${SYSDIR}/crypto/sha2
SRCS+= sha256c.c sha512c.c
# md5 from libmd
.PATH: ${SRCTOP}/lib/libmd
SRCS+= md5c.c
.if ${DO32:U0} == 0
MAN=libsa.3
.endif

View file

@ -5,16 +5,6 @@
# Our password input method
SRCS+= pwgets.c
# sha256 and sha512 from sys/crypto
.PATH: ${SYSDIR}/crypto/sha2
CFLAGS.sha256.c+= -DWEAK_REFS
CFLAGS.sha512.c+= -DWEAK_REFS
SRCS+= sha256c.c sha512c.c
# md5 from libmd
.PATH: ${SRCTOP}/lib/libmd
SRCS+= md5c.c
# AES implementation from sys/crypto
.PATH: ${SYSDIR}/crypto/rijndael
.for i in rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c
@ -23,7 +13,6 @@ CFLAGS.${i}+= -DNDEBUG
SRCS+= ${i}
.endfor
# local GELI Implementation
.PATH: ${SYSDIR}/geom/eli
.for i in gelidev.c geli_metadata.c