Create a persistent umac128.c source file: #define the output size and
authornaddy <naddy@openbsd.org>
Tue, 12 Dec 2017 15:06:12 +0000 (15:06 +0000)
committernaddy <naddy@openbsd.org>
Tue, 12 Dec 2017 15:06:12 +0000 (15:06 +0000)
the name of the entry points for UMAC-128 before including umac.c.
Idea from FreeBSD.
ok dtucker@

usr.bin/ssh/ssh-keyscan/Makefile
usr.bin/ssh/ssh-keysign/Makefile
usr.bin/ssh/ssh/Makefile
usr.bin/ssh/sshd/Makefile
usr.bin/ssh/umac.c
usr.bin/ssh/umac128.c [new file with mode: 0644]

index 6363e52..506c90e 100644 (file)
@@ -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 \
index 2746748..749af23 100644 (file)
@@ -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 \
index 604c897..8f967fd 100644 (file)
@@ -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 \
index 79b53c5..714a268 100644 (file)
@@ -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 \
index 41f5bfb..f69fb29 100644 (file)
@@ -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 (file)
index 0000000..af3bd9d
--- /dev/null
@@ -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"