diff options
| author | jsing <> | 2024-03-28 01:49:29 +0000 |
|---|---|---|
| committer | jsing <> | 2024-03-28 01:49:29 +0000 |
| commit | ee4f7c5caf1aa306d0a5b443f5c9133ae646925b (patch) | |
| tree | ca5f083b55057a8157b330fc459a97936af57f81 /src/lib/libcrypto/arch | |
| parent | 45f98f789c6ef09f937c978393d67f6741b3fe1f (diff) | |
| download | openbsd-ee4f7c5caf1aa306d0a5b443f5c9133ae646925b.tar.gz openbsd-ee4f7c5caf1aa306d0a5b443f5c9133ae646925b.tar.bz2 openbsd-ee4f7c5caf1aa306d0a5b443f5c9133ae646925b.zip | |
Use C functions for RC4 public API.
Rather than having public API switch between C and assembly, always
use C functions as entry points, which then call an assembly
implementation (if available). This makes it significantly easier
to deal with symbol aliasing/namespaces and it also means we
benefit from vulnerability prevention provided by the C compiler.
Rename the assembly generated functions from RC4() to rc4_internal()
and RC4_set_key() to rc4_set_key_internal(). Always include rc4.c
and change it to use defines that are similar to those used in BN.
ok beck@ joshua@ tb@
Diffstat (limited to 'src/lib/libcrypto/arch')
| -rw-r--r-- | src/lib/libcrypto/arch/amd64/Makefile.inc | 5 | ||||
| -rw-r--r-- | src/lib/libcrypto/arch/i386/Makefile.inc | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libcrypto/arch/amd64/Makefile.inc b/src/lib/libcrypto/arch/amd64/Makefile.inc index b04923b596..617b9feb9a 100644 --- a/src/lib/libcrypto/arch/amd64/Makefile.inc +++ b/src/lib/libcrypto/arch/amd64/Makefile.inc | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile.inc,v 1.16 2024/03/28 01:41:16 jsing Exp $ | 1 | # $OpenBSD: Makefile.inc,v 1.17 2024/03/28 01:49:29 jsing Exp $ |
| 2 | 2 | ||
| 3 | # amd64-specific libcrypto build rules | 3 | # amd64-specific libcrypto build rules |
| 4 | 4 | ||
| @@ -46,7 +46,10 @@ SSLASM+= md5 md5-x86_64 | |||
| 46 | CFLAGS+= -DGHASH_ASM | 46 | CFLAGS+= -DGHASH_ASM |
| 47 | SSLASM+= modes ghash-x86_64 | 47 | SSLASM+= modes ghash-x86_64 |
| 48 | # rc4 | 48 | # rc4 |
| 49 | CFLAGS+= -DHAVE_RC4_INTERNAL | ||
| 50 | CFLAGS+= -DHAVE_RC4_SET_KEY_INTERNAL | ||
| 49 | SSLASM+= rc4 rc4-x86_64 | 51 | SSLASM+= rc4 rc4-x86_64 |
| 52 | SRCS+= rc4.c | ||
| 50 | # ripemd | 53 | # ripemd |
| 51 | # sha | 54 | # sha |
| 52 | CFLAGS+= -DSHA1_ASM | 55 | CFLAGS+= -DSHA1_ASM |
diff --git a/src/lib/libcrypto/arch/i386/Makefile.inc b/src/lib/libcrypto/arch/i386/Makefile.inc index c1a52e786a..911f02073b 100644 --- a/src/lib/libcrypto/arch/i386/Makefile.inc +++ b/src/lib/libcrypto/arch/i386/Makefile.inc | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile.inc,v 1.13 2024/03/28 01:41:16 jsing Exp $ | 1 | # $OpenBSD: Makefile.inc,v 1.14 2024/03/28 01:49:29 jsing Exp $ |
| 2 | 2 | ||
| 3 | # i386-specific libcrypto build rules | 3 | # i386-specific libcrypto build rules |
| 4 | 4 | ||
| @@ -26,7 +26,10 @@ SSLASM+= md5 md5-586 | |||
| 26 | CFLAGS+= -DGHASH_ASM | 26 | CFLAGS+= -DGHASH_ASM |
| 27 | SSLASM+= modes ghash-x86 | 27 | SSLASM+= modes ghash-x86 |
| 28 | # rc4 | 28 | # rc4 |
| 29 | CFLAGS+= -DHAVE_RC4_INTERNAL | ||
| 30 | CFLAGS+= -DHAVE_RC4_SET_KEY_INTERNAL | ||
| 29 | SSLASM+= rc4 rc4-586 | 31 | SSLASM+= rc4 rc4-586 |
| 32 | SRCS+= rc4.c | ||
| 30 | # sha | 33 | # sha |
| 31 | CFLAGS+= -DSHA1_ASM | 34 | CFLAGS+= -DSHA1_ASM |
| 32 | SSLASM+= sha sha1-586 | 35 | SSLASM+= sha sha1-586 |
