Add blacklist feature for weak Debian-generated ssh keys.
[dragonfly.git] / secure / lib / libssh / Makefile.etc
1 # $DragonFly: src/secure/lib/libssh/Makefile.etc,v 1.3 2008/05/16 11:44:55 corecode Exp $
2 #
3
4 .include "../../Makefile.ssh.common"
5
6 FILES=          ${SSHDIR}/moduli
7 FILESDIR=       /etc/ssh
8 FILESOWN=       ${BINOWN}
9 FILESGRP=       ${BINGRP}
10 FILESMODE=      644
11
12 # make confuses the text file `moduli' with a binary which needs
13 # to be created from `moduli.c'.  Override this implicit rule by an
14 # explicit do-nothing.
15 ${SSHDIR}/moduli:
16         @true
17
18 BLACKLISTS!=    echo ${.CURDIR}/blacklist.*
19 .for bl in ${BLACKLISTS}
20 FILES+= short.${bl:T}
21 CLEANFILES+= short.${bl:T}
22 FILESNAME_short.${bl:T}=        ${bl:T}
23
24 short.${bl:T}: ${bl}
25         @printf "# After these initial comments, all the lines in this file must be\n" > ${.TARGET}
26         @printf "# exactly the same length, and must be in sorted order. Each line must\n" >> ${.TARGET}
27         @printf "# consist of the lower-case key fingerprint (ssh-keygen -l -f\n" >> ${.TARGET}
28         @printf "# /path/to/key), without colons, and with the first 12 characters\n" >> ${.TARGET}
29         @printf "# removed (that is, the lower 80 bits of the fingerprint). Unless these\n" >> ${.TARGET}
30         @printf "# rules are followed, the blacklist will not work properly. See\n" >> ${.TARGET}
31         @printf "# ssh-vulnkey(1).\n" >> ${.TARGET}
32         @printf "#\n" >> ${.TARGET}
33         @printf "# Copyright: (C) 2008 Canonical, Ltd., License: GPL-3.\n" >> ${.TARGET}
34         sed -ne '/^#/!q;p;' ${.ALLSRC} >> ${.TARGET}
35
36         grep -v '^#' ${.ALLSRC} | cut -d ' ' -f 2 | cut -b13- | sort >> ${.TARGET}
37
38 .endfor
39
40 .include <bsd.prog.mk>