From a3ef2fce0b740075bab6873e3b2281ed6699e2b5 Mon Sep 17 00:00:00 2001 From: naddy Date: Tue, 12 Dec 2017 15:06:12 +0000 Subject: [PATCH] Create a persistent umac128.c source file: #define the output size and the name of the entry points for UMAC-128 before including umac.c. Idea from FreeBSD. ok dtucker@ --- usr.bin/ssh/ssh-keyscan/Makefile | 11 +---------- usr.bin/ssh/ssh-keysign/Makefile | 11 +---------- usr.bin/ssh/ssh/Makefile | 11 +---------- usr.bin/ssh/sshd/Makefile | 11 +---------- usr.bin/ssh/umac.c | 4 +++- usr.bin/ssh/umac128.c | 9 +++++++++ 6 files changed, 16 insertions(+), 41 deletions(-) create mode 100644 usr.bin/ssh/umac128.c diff --git a/usr.bin/ssh/ssh-keyscan/Makefile b/usr.bin/ssh/ssh-keyscan/Makefile index 6363e52722f..506c90eefa7 100644 --- a/usr.bin/ssh/ssh-keyscan/Makefile +++ b/usr.bin/ssh/ssh-keyscan/Makefile @@ -1,18 +1,9 @@ -# $OpenBSD: Makefile,v 1.8 2017/12/10 19:37:57 deraadt Exp $ +# $OpenBSD: Makefile,v 1.9 2017/12/12 15:06:12 naddy Exp $ .PATH: ${.CURDIR}/.. SRCS= ssh-keyscan.c -umac128.c: umac.c - sed \ - -e "s/^#define UMAC_OUTPUT_LEN 8/#define UMAC_OUTPUT_LEN 16/" \ - -e s/umac_new/umac128_new/g \ - -e s/umac_update/umac128_update/g \ - -e s/umac_final/umac128_final/g \ - -e s/umac_delete/umac128_delete/g \ - < ${.CURDIR}/../umac.c > ${.TARGET} - SRCS+= addrmatch.c atomicio.c blocks.c canohost.c chacha.c \ cipher-chachapoly.c cipher.c cleanup.c compat.c dh.c digest-openssl.c \ dispatch.c ed25519.c fe25519.c ge25519.c hash.c hmac.c hostfile.c \ diff --git a/usr.bin/ssh/ssh-keysign/Makefile b/usr.bin/ssh/ssh-keysign/Makefile index 274674806f4..749af238330 100644 --- a/usr.bin/ssh/ssh-keysign/Makefile +++ b/usr.bin/ssh/ssh-keysign/Makefile @@ -1,18 +1,9 @@ -# $OpenBSD: Makefile,v 1.10 2017/12/10 19:37:57 deraadt Exp $ +# $OpenBSD: Makefile,v 1.11 2017/12/12 15:06:12 naddy Exp $ .PATH: ${.CURDIR}/.. SRCS= ssh-keysign.c readconf.c -umac128.c: umac.c - sed \ - -e "s/^#define UMAC_OUTPUT_LEN 8/#define UMAC_OUTPUT_LEN 16/" \ - -e s/umac_new/umac128_new/g \ - -e s/umac_update/umac128_update/g \ - -e s/umac_final/umac128_final/g \ - -e s/umac_delete/umac128_delete/g \ - < ${.CURDIR}/../umac.c > ${.TARGET} - SRCS+= addrmatch.c atomicio.c authfile.c bitmap.c blocks.c canohost.c \ chacha.c cipher-chachapoly.c cipher.c cleanup.c digest-openssl.c \ dispatch.c ed25519.c fatal.c fe25519.c ge25519.c hash.c hmac.c kex.c \ diff --git a/usr.bin/ssh/ssh/Makefile b/usr.bin/ssh/ssh/Makefile index 604c89712a4..8f967fd302f 100644 --- a/usr.bin/ssh/ssh/Makefile +++ b/usr.bin/ssh/ssh/Makefile @@ -1,18 +1,9 @@ -# $OpenBSD: Makefile,v 1.68 2017/12/10 19:37:57 deraadt Exp $ +# $OpenBSD: Makefile,v 1.69 2017/12/12 15:06:12 naddy Exp $ .PATH: ${.CURDIR}/.. SRCS= ssh.c readconf.c clientloop.c sshtty.c sshconnect.c sshconnect2.c mux.c -umac128.c: umac.c - sed \ - -e "s/^#define UMAC_OUTPUT_LEN 8/#define UMAC_OUTPUT_LEN 16/" \ - -e s/umac_new/umac128_new/g \ - -e s/umac_update/umac128_update/g \ - -e s/umac_final/umac128_final/g \ - -e s/umac_delete/umac128_delete/g \ - < ${.CURDIR}/../umac.c > ${.TARGET} - SRCS+= addrmatch.c atomicio.c authfd.c authfile.c bitmap.c blocks.c bufaux.c \ bufbn.c bufec.c buffer.c canohost.c chacha.c channels.c \ cipher-chachapoly.c cipher.c compat.c crc32.c dh.c digest-openssl.c \ diff --git a/usr.bin/ssh/sshd/Makefile b/usr.bin/ssh/sshd/Makefile index 79b53c5e541..714a268a90d 100644 --- a/usr.bin/ssh/sshd/Makefile +++ b/usr.bin/ssh/sshd/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.91 2017/12/10 19:37:57 deraadt Exp $ +# $OpenBSD: Makefile,v 1.92 2017/12/12 15:06:12 naddy Exp $ .PATH: ${.CURDIR}/.. @@ -8,15 +8,6 @@ SRCS= sshd.c auth-rhosts.c auth-passwd.c sshpty.c sshlogin.c servconf.c \ auth2-none.c auth2-passwd.c auth2-pubkey.c monitor.c monitor_wrap.c \ sftp-server.c sftp-common.c sandbox-pledge.c -umac128.c: umac.c - sed \ - -e "s/^#define UMAC_OUTPUT_LEN 8/#define UMAC_OUTPUT_LEN 16/" \ - -e s/umac_new/umac128_new/g \ - -e s/umac_update/umac128_update/g \ - -e s/umac_final/umac128_final/g \ - -e s/umac_delete/umac128_delete/g \ - < ${.CURDIR}/../umac.c > ${.TARGET} - SRCS+= addrmatch.c atomicio.c authfd.c authfile.c bitmap.c blocks.c bufaux.c \ bufbn.c bufec.c buffer.c canohost.c chacha.c channels.c \ cipher-chachapoly.c cipher.c compat.c crc32.c dh.c digest-openssl.c \ diff --git a/usr.bin/ssh/umac.c b/usr.bin/ssh/umac.c index 41f5bfba455..f69fb291da9 100644 --- a/usr.bin/ssh/umac.c +++ b/usr.bin/ssh/umac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umac.c,v 1.15 2017/11/28 06:09:38 djm Exp $ */ +/* $OpenBSD: umac.c,v 1.16 2017/12/12 15:06:12 naddy Exp $ */ /* ----------------------------------------------------------------------- * * umac.c -- C Implementation UMAC Message Authentication @@ -52,7 +52,9 @@ /* --- User Switches ---------------------------------------------------- */ /* ---------------------------------------------------------------------- */ +#ifndef UMAC_OUTPUT_LEN #define UMAC_OUTPUT_LEN 8 /* Alowable: 4, 8, 12, 16 */ +#endif /* #define FORCE_C_ONLY 1 ANSI C and 64-bit integers req'd */ /* #define AES_IMPLEMENTAION 1 1 = OpenSSL, 2 = Barreto, 3 = Gladman */ /* #define SSE2 0 Is SSE2 is available? */ diff --git a/usr.bin/ssh/umac128.c b/usr.bin/ssh/umac128.c new file mode 100644 index 00000000000..af3bd9d3fc1 --- /dev/null +++ b/usr.bin/ssh/umac128.c @@ -0,0 +1,9 @@ +/* $OpenBSD: umac128.c,v 1.1 2017/12/12 15:06:12 naddy Exp $ */ + +#define UMAC_OUTPUT_LEN 16 +#define umac_new umac128_new +#define umac_update umac128_update +#define umac_final umac128_final +#define umac_delete umac128_delete + +#include "umac.c" -- 2.20.1