Merge a bunch of things from crypto-us and crypto-intl into basesrc,

adding support for Heimdal/KTH Kerberos where easy to do so.  Eliminate
bsd.crypto.mk.

There is still a bunch more work to do, but crypto is now more-or-less
fully merged into the base NetBSD distribution.
This commit is contained in:
thorpej 2000-06-20 06:00:24 +00:00
parent 76baab0725
commit e7d6b96938
26 changed files with 353 additions and 257 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.117 2000/05/21 07:33:05 mrg Exp $
# $NetBSD: Makefile,v 1.118 2000/06/20 06:00:24 thorpej Exp $
# This is the top-level makefile for building NetBSD. For an outline of
# how to build a snapshot or release, as well as other release engineering
@ -36,12 +36,7 @@
# more information on this.)
# snapshot: a synonym for release.
SRCTOP=.
.include <bsd.crypto.mk> # for configuration variables.
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/Makefile.frag"
.endif
.include <bsd.own.mk>
MKOBJDIRS ?= no
HAVE_EGCS!= ${CXX} --version | egrep "^(2\.[89]|egcs)" ; echo
@ -152,9 +147,6 @@ build: buildmsg beforeinstall
(cd ${.CURDIR}/gnu/lib && \
${MAKE} ${_M} ${_J} MKSHARE=no dependall && \
${MAKE} ${_M} MKSHARE=no install)
.if target(cryptobuild)
${MAKE} ${_M} ${_J} cryptobuild
.endif
${MAKE} ${_M} ${_J} dependall && ${MAKE} ${_M} _BUILD= install
.if defined(DOMESTIC) && !defined(EXPORTABLE_SYSTEM)
(cd ${.CURDIR}/${DOMESTIC} && ${MAKE} ${_M} ${_J} _SLAVE_BUILD= build)

View File

@ -1,14 +1,18 @@
# $NetBSD: Makefile,v 1.16 1999/07/20 09:35:19 mrg Exp $
# $NetBSD: Makefile,v 1.17 2000/06/20 06:00:27 thorpej Exp $
# @(#)Makefile 8.1 (Berkeley) 7/19/93
SRCTOP= ../..
.include <bsd.crypto.mk>
PROG= rcp
SRCS= rcp.c util.c
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/bin/rcp/Makefile.frag"
.endif
# XXX Kerberos support broken right now.
#RLOGIN= ${.CURDIR}/../../usr.bin/rlogin
#SRCS+= krcmd.c kcmd.c
#CPPFLAGS+= -DKERBEROS -DCRYPT -I${RLOGIN}
#LDADD+= -lkrb -ldes
#DPADD+= ${LIBKRB} ${LIBDES}
#.PATH: ${RLOGIN}
.include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.1 2000/03/28 00:38:06 thorpej Exp $
# $NetBSD: Makefile,v 1.2 2000/06/20 06:00:27 thorpej Exp $
# The `all' target must appear before bsd.own.mk is pulled in.
all:
@ -11,25 +11,6 @@ all:
.include <bsd.own.mk>
SRCTOP= ../..
.include <bsd.crypto.mk>
.if defined(CRYPTOBASE) && (${CRYPTOBASE} != "none")
CRYPTOWHICH!= basename ${CRYPTOBASE}
.endif
.if defined(CRYPTOWHICH)
.if (${CRYPTOWHICH} == "crypto-us")
CHECKFLIST_CRYPTOARG=-secr
CRYPTOSET="secr"
.endif
.if (${CRYPTOWHICH} == "crypto-intl")
CHECKFLIST_CRYPTOARG=-cryptint
CRYPTOSET="cryptint"
.endif
.endif # defined(CRYPTOWHICH)
#
# UTILITY TARGETS
#
@ -56,36 +37,15 @@ check_releasedir: .PHONY
.PRECIOUS: checkflist
checkflist: check_destdir
DESTDIR=${DESTDIR} sh ${.CURDIR}/checkflist ${CHECKFLIST_CRYPTOARG}
maketars_base: check_destdir check_releasedir
sh ${.CURDIR}/maketars -d ${DESTDIR} -t ${RELEASEDIR}/binary/sets
maketars_crypto: check_destdir check_releasedir
sh ${.CURDIR}/maketars -d ${DESTDIR} -t ${RELEASEDIR}/binary/security \
${CRYPTOSET}
DESTDIR=${DESTDIR} sh ${.CURDIR}/checkflist
.PRECIOUS: maketars
maketars: maketars_base
.if defined(CRYPTOSET)
@${MAKE} maketars_crypto
.else
@true
.endif
makesums_base: check_releasedir
sh ${.CURDIR}/makesums -t ${RELEASEDIR}/binary/sets
makesums_crypto: check_releasedir
sh ${.CURDIR}/makesums -t ${RELEASEDIR}/binary/security
maketars: check_destdir check_releasedir
sh ${.CURDIR}/maketars -d ${DESTDIR} -t ${RELEASEDIR}/binary/sets
.PRECIOUS: makesums
makesums: makesums_base
.if defined(CRYPTOSET)
@${MAKE} makesums_crypto
.else
@true
.endif
makesums: check_releasedir
sh ${.CURDIR}/makesums -t ${RELEASEDIR}/binary/sets
#
# MAIN ENTRY POINTS
@ -93,12 +53,3 @@ makesums: makesums_base
sets: maketars makesums
@true
cryptoset: .PHONY
.if defined(CRYPTOSET)
${MAKE} maketars_crypto
${MAKE} makesums_crypto
.else
@echo "No crypto set to make."
@false
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: README,v 1.3 2000/06/14 06:32:31 cgd Exp $
# $NetBSD: README,v 1.4 2000/06/20 06:00:28 thorpej Exp $
To: "NetBSD Port Maintainers"
Subject: distribution sets, etc...
@ -44,10 +44,6 @@ N machine-dependent files (one per architecture), named "md.${ARCH}".
the sets are as follows:
secr: security software -- the non-exportable bits, i.e.
those that actually use crypt, and have it compiled
in.
base: the base binary set. excludes everything described
below.

View File

@ -1,6 +1,6 @@
#! /bin/sh --
#
# $NetBSD: checkflist,v 1.12 2000/01/06 21:03:34 abs Exp $
# $NetBSD: checkflist,v 1.13 2000/06/20 06:00:28 thorpej Exp $
#
# Verify output of makeflist against contents of $DESTDIR.
@ -26,12 +26,6 @@ while : ; do
-both)
xargs="-b"
;;
-secr)
dargs="-d"
;;
-cryptint)
dargs="-i"
;;
-u)
diffargs="-u"
;;
@ -43,8 +37,6 @@ while : ; do
Usage: $0 [-x11|-both] [-secr]
-x11 check only x11 lists
-both check netbsd + x11 lists
-secr check domestic ("secr") lists
-cryptint check international crypto ("cryptint") lists
-u output differences in "unified diff" style
-c output differences in "context diff" style
USAGE

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: makeflist,v 1.20 2000/01/23 20:31:17 jwise Exp $
# $NetBSD: makeflist,v 1.21 2000/06/20 06:00:28 thorpej Exp $
#
# Print out the files in some or all lists.
# Usage: makeflist [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
@ -18,14 +18,6 @@ lists=$nlists
# handle args
while : ; do
case $1 in
-d*)
nlists="$nlists secr"
lists=$nlists
;;
-i*)
nlists="$nlists cryptint"
lists=$nlists
;;
-b*)
lists="$xlists $nlists"
;;
@ -45,8 +37,6 @@ while : ; do
cat 1>&2 <<USAGE
Usage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] [setname ...]
-b make netbsd + x11 lists
-d do domestic ("secr") sets
-i do international crypto ("cryptint") sets
-x only make x11 lists
-a arch set arch (e.g, m68k, mips, powerpc) [$arch]
-m machine set machine (e.g, amiga, i386, macppc) [$machine]

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.153 2000/06/12 06:23:21 fredb Exp $
# $NetBSD: Makefile,v 1.154 2000/06/20 06:00:28 thorpej Exp $
# from: @(#)Makefile 8.7 (Berkeley) 5/25/95
# Environment variables without default values:
@ -25,11 +25,7 @@
# BUILD_KERNELS are a machine-dependent list of kernels that should just
# be built in place but not made into sets or installed, e.g., an
# INSTALL kernel used later in src/distrib/.
# CRYPTOPATH is automatically defined by bsd.crypto.mk to be either
# ../crypto-us or ../crypto-intl. It controls the building of
# the secr set, which can be disabled by setting CRYPTOPATH to
# "none".
#
#
# Targets:
# distribution: makes a full NetBSD distribution in DESTDIR. If
# INSTALL_DONE is set, it will not do a `make install.'
@ -43,10 +39,8 @@
# do this before bsd.own.mk so we get correct KERNSRCDIR
.include "../Makefile.inc"
# For NO_SENDMAIL and INSTPRIV and CRYPTOPATH
# For NO_SENDMAIL and INSTPRIV
.include <bsd.own.mk>
SRCTOP= ..
.include <bsd.crypto.mk>
TZDIR= /usr/share/zoneinfo
LOCALTIME?= US/Pacific
@ -257,9 +251,6 @@ release snapshot: distribution snap_pre snap_md_pre snap_kern snap_md_post
(cd ../distrib/sets; ${MAKE} sets)
sh ../distrib/sets/makesums -t ${RELEASEDIR}/binary/kernel '*.gz'
cryptoset: distribution snap_pre snap_md_pre snap_kern snap_md_post
(cd ../distrib/sets; ${MAKE} cryptoset)
snap_pre:
/bin/rm -rf ${RELEASEDIR}
${INSTALL} ${INSTPRIV} -d -o root -g wheel -m 755 ${RELEASEDIR}

View File

@ -1,9 +1,6 @@
# $NetBSD: Makefile,v 1.90 2000/06/03 11:23:54 fvdl Exp $
# $NetBSD: Makefile,v 1.91 2000/06/20 06:00:32 thorpej Exp $
# @(#)Makefile 8.2 (Berkeley) 1/4/94
SRCTOP= ..
.include <bsd.crypto.mk>
# Doing a make includes builds /usr/include
# Missing: mp.h
@ -32,9 +29,5 @@ MKOBJ= no
SUBDIR= rpc
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/include/Makefile.frag"
.endif
.include <bsd.prog.mk>
.include <bsd.subdir.mk>

View File

@ -1,20 +1,23 @@
# $NetBSD: Makefile,v 1.60 2000/06/16 16:18:46 thorpej Exp $
# $NetBSD: Makefile,v 1.61 2000/06/20 06:00:33 thorpej Exp $
# from: @(#)Makefile 5.25.1.1 (Berkeley) 5/7/91
SRCTOP= ..
.include <bsd.crypto.mk>
SUBDIR= csu libarch libbz2 libc libcompat libcrypt libcurses libedit \
libkvm libl libm libmenu libossaudio libpcap libposix \
libresolv librmt librpcsvc libskey libterm libusb libutil libwrap \
liby libz
# XXX Crypto bits must be done before libtelnet.
# OpenSSL libraries. NOTE! WE DO NOT TRAVERSE INTO libdes FOR A REASON!
SUBDIR+= libcrypto libssl
# XXX Crypto bits must be dealt with before libtelnet.
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/lib/Makefile.frag"
.endif
# Heimdal Kerberos 5 libraries
SUBDIR+= libroken libcom_err libsl libss libasn1 libkrb5 libhdb libkadm5 \
libkadm5srv libkadm5clnt libgssapi
# KTH Kerberos 4 libraries
SUBDIR+= libkrb libkdb libkadm libkafs
SUBDIR+= libkstream
SUBDIR+= libtelnet

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2000/06/16 06:16:38 thorpej Exp $
# $NetBSD: Makefile,v 1.3 2000/06/20 06:00:33 thorpej Exp $
# RCSid:
# Id: Makefile,v 1.33 1998/11/11 11:53:53 sjg Exp
@ -65,6 +65,9 @@ INCS+= rsaref.h
INCSDIR=/usr/include/openssl
LINKS+= ${INCSDIR}/des.h ${DESTDIR}/usr/include/des.h
LINKS+= ${INCSDIR}/des.h ${DESTDIR}/usr/include/kerberosIV/des.h
# this rebuilds the `srcs.inc' and the .inc files it reads.
# note that we have no idea, rc5 or rsa here so we include
# them explicitely above if we are using these ciphers.
@ -74,4 +77,34 @@ update_inc:
-name Makefile.ssl | \
perl ${OPENSSLSRC}/extsrcs.pl 2> srcs.inc )
DES_SHLIB_MAJOR != cd ${.CURDIR}/../libdes && make print-shlib-major
DES_SHLIB_MINOR != cd ${.CURDIR}/../libdes && make print-shlib-minor
LINKS+= ${LIBDIR}/libcrypto.a ${LIBDIR}/libdes.a
.include <bsd.own.mk>
.if ${MKPROFILE} != "no"
LINKS+= ${LIBDIR}/libcrypto_p.a ${LIBDIR}/libdes_p.a
.endif
.if ${MKPIC} != "no"
.if ${MKPICINSTALL} != "no"
LINKS+= ${LIBDIR}/libcrypto_pic.a ${LIBDIR}/libdes_pic.a
.endif
.if exists(${.CURDIR}/shlib_version)
LINKS+= ${LIBDIR}/libcrypto.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
${LIBDIR}/libdes.so.${DES_SHLIB_MAJOR}.${DES_SHLIB_MINOR}
.if (${OBJECT_FMT} == "ELF")
LINKS+= ${LIBDIR}/libcrypto.so.${SHLIB_MAJOR} \
${LIBDIR}/libdes.so.${DES_SHLIB_MAJOR}
LINKS+= ${LIBDIR}/libcrypto.so ${LIBDIR}/libdes.so
.endif
.endif
.endif # ${MKPIC} != "no"
.include <bsd.lib.mk>

View File

@ -1,15 +1,23 @@
# from: @(#)Makefile 8.2 (Berkeley) 12/15/93
# $NetBSD: Makefile,v 1.9 1999/07/20 09:35:19 mrg Exp $
# $NetBSD: Makefile,v 1.10 2000/06/20 06:00:34 thorpej Exp $
SRCTOP= ../..
.include <bsd.crypto.mk>
# XXX XXX XXX
WARNS=0
DIST= ${.CURDIR}/../../crypto/dist
.PATH: ${DIST}/heimdal/appl/telnet/libtelnet .DOTLAST
LIB= telnet
SRCS= auth.c encrypt.c genget.c getent.c misc.c
CPPFLAGS+= -DHAS_CGETENT
SRCS= auth.c enc_des.c encrypt.c genget.c getent.c misc.c \
kerberos.c kerberos5.c
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/lib/libtelnet/Makefile.frag"
.endif
CPPFLAGS+= -DHAS_CGETENT
CPPFLAGS+= -I${DIST}/heimdal/appl/telnet/libtelnet
CPPFLAGS+= -I${.CURDIR}/../../include/heimdal
CPPFLAGS+= -I${DESTDIR}/usr/include/kerberosIV
CPPFLAGS+= -I${DESTDIR}/usr/include/krb5
CPPFLAGS+= -I${DESTDIR}/usr/include/krb
CPPFLAGS+= -I${DESTDIR}/usr/include/openssl
CPPFLAGS+= -DHAVE_CONFIG_H
.include <bsd.lib.mk>

View File

@ -1,5 +1,5 @@
# $NetBSD: shlib_version,v 1.5 1999/06/24 22:44:56 tls Exp $
# $NetBSD: shlib_version,v 1.6 2000/06/20 06:00:34 thorpej Exp $
# Remember to update distrib/sets/lists/base/shl.* when changing
#
major=2
major=3
minor=0

View File

@ -1,16 +1,12 @@
# $NetBSD: Makefile,v 1.36 1999/08/09 22:46:16 aidan Exp $
# $NetBSD: Makefile,v 1.37 2000/06/20 06:00:34 thorpej Exp $
# @(#)Makefile 8.1 (Berkeley) 6/4/93
SRCTOP=..
.include <bsd.crypto.mk>
SUBDIR= atrun comsat fingerd ftpd getNAME getty identd ld.aout_so \
ld.elf_so lfs_cleanerd mail.local makekey makewhatis rexecd \
rlogind rmail rshd rpc.rquotad rpc.rstatd rpc.rusersd rpc.rwalld \
rpc.sprayd talkd telnetd tftpd uucpd
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/libexec/Makefile.frag"
.endif
# Heimdal/KTH Kerberos
SUBDIR+= hprop hpropd kadmind kdc kfd kpasswdd
.include <bsd.subdir.mk>

View File

@ -1,9 +1,6 @@
# $NetBSD: Makefile,v 1.41 2000/06/14 13:44:21 lukem Exp $
# $NetBSD: Makefile,v 1.42 2000/06/20 06:00:34 thorpej Exp $
# @(#)Makefile 8.2 (Berkeley) 4/4/94
SRCTOP= ../..
.include <bsd.crypto.mk>
PROG= ftpd
SRCS= cmds.c conf.c ftpd.c ftpcmd.y logutmp.c logwtmp.c popen.c
CPPFLAGS+=-DHASSETPROCTITLE
@ -28,8 +25,19 @@ LDADD+= -lskey
ftpd.o ftpcmd.o: version.h
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/libexec/ftpd/Makefile.frag"
.endif
# XXX Kerberos support is broken right now.
#.PATH: ${.CURDIR}/../../usr.bin/login
#.ifdef KERBEROS5
#SRCS+= k5login.c
#CPPFLAGS+=-DKERBEROS5
#DPADD+= ${LIBKRB5} ${LIBK5CRYPTO} ${LIBCOM_ERR}
#LDADD+= -lkrb5 -lk5crypto -lcom_err
#.else
#SRCS+= klogin.c
#CPPFLAGS+=-DKERBEROS
#DPADD+= ${LIBKRB} ${LIBDES} ${LIBCOM_ERR}
#LDADD+= -lkrb -kdes -lcom_err
#.endif
.include <bsd.prog.mk>

View File

@ -1,8 +1,11 @@
# $NetBSD: Makefile,v 1.22 1999/07/20 09:35:20 mrg Exp $
# $NetBSD: Makefile,v 1.23 2000/06/20 06:00:35 thorpej Exp $
# from: @(#)Makefile 8.2 (Berkeley) 12/15/93
SRCTOP= ../..
.include <bsd.crypto.mk>
DIST= ${.CURDIR}/../../crypto/dist
.PATH: ${DIST}/heimdal/appl/telnet/telnetd .DOTLAST
# XXX XXX XXX
WARNS=0
MAN= telnetd.8
@ -16,9 +19,14 @@ SRCS= authenc.c global.c slc.c state.c sys_term.c telnetd.c \
DPADD= ${LIBUTIL} ${LIBTERMCAP} ${LIBTELNET}
LDADD+= -lutil -ltermcap -ltelnet
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/libexec/telnetd/Makefile.frag"
.endif
CPPFLAGS+= -I${DIST}/heimdal/appl/telnet
CPPFLAGS+= -I${.CURDIR}/../../include/heimdal
CPPFLAGS+= -I${DESTDIR}/usr/include/kerberosIV
CPPFLAGS+= -I${DESTDIR}/usr/include/krb5
CPPFLAGS+= -I${DESTDIR}/usr/include/openssl
CPPFLAGS+= -DHAVE_CONFIG_H
LDADD+= -lkrb5 -lkrb -lcrypto -lasn1 -lcom_err -lroken
CPPFLAGS+=-I${.CURDIR}

View File

@ -1,13 +1,6 @@
# $NetBSD: Makefile,v 1.9 1999/09/26 10:22:29 mrg Exp $
SRCTOP= ..
.include <bsd.crypto.mk>
# $NetBSD: Makefile,v 1.10 2000/06/20 06:00:35 thorpej Exp $
# missing: bin libexec sbin usr.sbin share games gnu
SUBDIR+= include lib sys usr.bin
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/regress/Makefile.frag"
.endif
.include <bsd.subdir.mk>

View File

@ -1,15 +1,13 @@
# $NetBSD: Makefile,v 1.28 2000/05/02 03:43:15 sjg Exp $
# $NetBSD: Makefile,v 1.29 2000/06/20 06:00:35 thorpej Exp $
# @(#)Makefile 8.1 (Berkeley) 6/8/93
.include <bsd.own.mk>
.if ${MKSHARE} != "no"
FILES= bsd.README bsd.crypto.mk bsd.doc.mk bsd.dep.mk \
bsd.depall.mk bsd.files.mk bsd.hostprog.mk \
bsd.inc.mk bsd.info.mk bsd.kernobj.mk bsd.kinc.mk bsd.kmod.mk \
bsd.lib.mk bsd.links.mk bsd.man.mk bsd.nls.mk \
bsd.obj.mk bsd.own.mk bsd.prog.mk \
bsd.subdir.mk bsd.sys.mk sys.mk
FILES= bsd.README bsd.doc.mk bsd.dep.mk bsd.depall.mk bsd.files.mk \
bsd.hostprog.mk bsd.inc.mk bsd.info.mk bsd.kernobj.mk bsd.kinc.mk \
bsd.kmod.mk bsd.lib.mk bsd.links.mk bsd.man.mk bsd.nls.mk \
bsd.obj.mk bsd.own.mk bsd.prog.mk bsd.subdir.mk bsd.sys.mk sys.mk
FILESDIR=/usr/share/mk
.endif

View File

@ -1,30 +0,0 @@
# $NetBSD: bsd.crypto.mk,v 1.1 1999/07/11 20:17:01 thorpej Exp $
# XXX error out if SRCTOP isn't defined.
.include <bsd.own.mk> # for configuration variables
# Compatibility with old Makefile variables
.if defined(EXPORTABLE_SYSTEM)
CRYPTOBASE=none
.endif
.if !defined(CRYPTOBASE)
.if exists(${SRCTOP}/crypto-us)
CRYPTOBASE=crypto-us
.elif exists(${SRCTOP}/crypto-intl)
CRYPTOBASE=crypto-intl
.else
.undef CRYPTOBASE
.endif # exists
.endif # CRYPTOBASE
.if defined(CRYPTOBASE) && (${CRYPTOBASE} != "none")
CRYPTOPATH=${SRCTOP}/${CRYPTOBASE}
.else
.undef CRYPTOPATH
.endif
.if defined(CRYPTOPATH) && !exists(${CRYPTOPATH})
.undef CRYPTOPATH
.endif

View File

@ -1,9 +1,6 @@
# $NetBSD: Makefile,v 1.108 2000/06/16 16:19:33 thorpej Exp $
# $NetBSD: Makefile,v 1.109 2000/06/20 06:00:36 thorpej Exp $
# from: @(#)Makefile 8.3 (Berkeley) 1/7/94
SRCTOP= ..
.include <bsd.crypto.mk>
SUBDIR= apply apropos asa at audio banner basename biff \
bzip2 bzip2recover cal calendar cap_mkdb cdplay checknr chflags \
chpass cksum cmp col colcrt colrm column comm compress \
@ -29,8 +26,6 @@ SUBDIR= apply apropos asa at audio banner basename biff \
SUBDIR+= openssl
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/usr.bin/Makefile.frag"
.endif
SUBDIR+= compile_et kdestroy kf kinit klist kpasswd mk_cmds string2key
.include <bsd.subdir.mk>

View File

@ -1,9 +1,6 @@
# $NetBSD: Makefile,v 1.28 2000/01/13 12:43:19 mjl Exp $
# $NetBSD: Makefile,v 1.29 2000/06/20 06:00:36 thorpej Exp $
# @(#)Makefile 8.1 (Berkeley) 7/19/93
SRCTOP= ../..
.include <bsd.crypto.mk>
PROG= login
SRCS= login.c
DPADD+= ${LIBUTIL} ${LIBCRYPT}
@ -21,8 +18,12 @@ DPADD+= ${LIBSKEY}
LDADD+= -lskey
.endif
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/usr.bin/login/Makefile.frag"
.endif
SRCS+= k5login.c
CPPFLAGS+=-DKERBEROS5 -I${DESTDIR}/usr/include/krb5
LDADD+= -lkrb5 -lcrypto -lasn1 -lcom_err -lroken
SRCS+= klogin.c
CPPFLAGS+=-DKERBEROS -I${DESTDIR}/usr/include/kerberosIV
LDADD+= -lkrb
.include <bsd.prog.mk>

View File

@ -1,9 +1,6 @@
# $NetBSD: Makefile,v 1.24 2000/01/12 05:13:32 mjl Exp $
# $NetBSD: Makefile,v 1.25 2000/06/20 06:00:37 thorpej Exp $
# from: @(#)Makefile 8.3 (Berkeley) 4/2/94
SRCTOP= ../..
.include <bsd.crypto.mk>
PROG= passwd
SRCS= local_passwd.c yp_passwd.c passwd.c
DPADD+= ${LIBRPCSVC} ${LIBCRYPT} ${LIBUTIL}
@ -19,9 +16,9 @@ BINMODE=4555
INSTALLFLAGS=-fschg
.endif
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/usr.bin/passwd/Makefile.frag"
.endif
CPPFLAGS+= -DKERBEROS5 -I${DESTDIR}/usr/include/krb5
SRCS+= krb5_passwd.c
LDADD+= -lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lcrypt
.include <bsd.prog.mk>

View File

@ -0,0 +1,179 @@
/* $NetBSD: krb5_passwd.c,v 1.8 2000/06/20 06:00:37 thorpej Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to
* The NetBSD Foundation by Johan Danielsson.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/* uses the `Kerberos Change Password Protocol' */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <err.h>
#include <openssl/des.h>
#include <krb5.h>
#include "extern.h"
static krb5_context context;
static krb5_principal defprinc;
static int usage = PW_USE;
int
krb5_init(const char *progname)
{
return krb5_init_context(&context);
}
int
krb5_arg (char ch, const char *optarg)
{
krb5_error_code ret;
switch(ch) {
case '5':
case 'k':
usage = PW_USE_FORCE;
return 1;
case 'u':
ret = krb5_parse_name(context, optarg, &defprinc);
if(ret) {
krb5_warn(context, ret, "%s", optarg);
return 0;
}
return 1;
}
return 0;
}
int
krb5_arg_end(void)
{
return usage;
}
void
krb5_end(void)
{
if(defprinc)
krb5_free_principal(context, defprinc);
krb5_free_context(context);
}
int
krb5_chpw(const char *username)
{
krb5_error_code ret;
krb5_context context;
krb5_principal principal;
krb5_get_init_creds_opt opt;
krb5_creds cred;
int result_code;
krb5_data result_code_string, result_string;
char pwbuf[BUFSIZ];
ret = krb5_init_context (&context);
if (ret) {
warnx("failed kerberos initialisation: %s",
krb5_get_err_text(context, ret));
return 1;
}
krb5_get_init_creds_opt_init (&opt);
krb5_get_init_creds_opt_set_tkt_life (&opt, 300);
krb5_get_init_creds_opt_set_forwardable (&opt, FALSE);
krb5_get_init_creds_opt_set_proxiable (&opt, FALSE);
if(username != NULL) {
ret = krb5_parse_name (context, username, &principal);
if (ret) {
warnx("failed to parse principal: %s",
krb5_get_err_text(context, ret));
return 1;
}
} else
principal = defprinc;
ret = krb5_get_init_creds_password (context,
&cred,
principal,
NULL,
krb5_prompter_posix,
NULL,
0,
"kadmin/changepw",
&opt);
switch (ret) {
case 0:
break;
case KRB5_LIBOS_PWDINTR :
/* XXX */
return 1;
case KRB5KRB_AP_ERR_BAD_INTEGRITY :
case KRB5KRB_AP_ERR_MODIFIED :
fprintf(stderr, "Password incorrect\n");
return 1;
break;
default:
warnx("failed to get credentials: %s",
krb5_get_err_text(context, ret));
return 1;
}
krb5_data_zero (&result_code_string);
krb5_data_zero (&result_string);
/* XXX use getpass? It has a broken interface. */
if(des_read_pw_string (pwbuf, sizeof(pwbuf), "New password: ", 1) != 0)
return 1;
ret = krb5_change_password (context, &cred, pwbuf,
&result_code,
&result_code_string,
&result_string);
if (ret)
krb5_err (context, 1, ret, "krb5_change_password");
printf ("%.*s\n", (int)result_string.length, (char *)result_string.data);
krb5_data_free (&result_code_string);
krb5_data_free (&result_string);
krb5_free_creds_contents (context, &cred);
krb5_free_context (context);
return result_code;
}

View File

@ -1,9 +1,6 @@
# $NetBSD: Makefile,v 1.14 1999/07/20 09:35:21 mrg Exp $
# $NetBSD: Makefile,v 1.15 2000/06/20 06:00:38 thorpej Exp $
# @(#)Makefile 8.1 (Berkeley) 7/19/93
SRCTOP= ../..
.include <bsd.crypto.mk>
PROG= rlogin
SRCS= rlogin.c
@ -11,8 +8,12 @@ BINOWN= root
BINMODE=4555
#INSTALLFLAGS=-fschg
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/usr.bin/rlogin/Makefile.frag"
.endif
# XXX Kerberos support broken right now.
#SRCS+= kcmd.c
#CPPFLAGS+=-DKERBEROS -DCRYPT
#DPADD+= ${LIBKSTREAM} ${LIBKRB} ${LIBDES} ${LIBCOM_ERR}
#LDADD+= -lkstream -lkrb -ldes -lcom_err
.include <bsd.prog.mk>

View File

@ -1,9 +1,6 @@
# $NetBSD: Makefile,v 1.17 2000/01/14 02:39:14 mjl Exp $
# $NetBSD: Makefile,v 1.18 2000/06/20 06:00:38 thorpej Exp $
# from: @(#)Makefile 8.1 (Berkeley) 7/19/93
SRCTOP= ../..
.include <bsd.crypto.mk>
PROG= su
DPADD+= ${LIBCRYPT}
LDADD+= -lcrypt -lutil
@ -16,10 +13,15 @@ CPPFLAGS+=-DLOGIN_CAP
#
#CPPFLAGS+=-DSUGROUP=\"sugroup\"
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/usr.bin/su/Makefile.frag"
.ifdef AFS
DPADD+= ${LIBKAFS}
LDADD+= -lkafs
.endif
CPPFLAGS+=-DKERBEROS -I${DESTDIR}/usr/include/kerberosIV
DPADD+= ${LIBKRB} ${LIBDES} ${LIBCOM_ERR} ${LIBROKEN}
LDADD+= -lkrb -ldes -lcom_err -lroken
.include <bsd.prog.mk>
.ifdef SKEY

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.19 1999/07/20 09:35:21 mrg Exp $
# $NetBSD: Makefile,v 1.20 2000/06/20 06:00:38 thorpej Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -34,8 +34,11 @@
# from: @(#)Makefile 8.1 (Berkeley) 6/6/93
#
SRCTOP= ../..
.include <bsd.crypto.mk>
DIST= ${.CURDIR}/../../crypto/dist
.PATH: ${DIST}/heimdal/appl/telnet/telnet .DOTLAST
# XXX XXX XXX
WARNS=0
PROG= telnet
@ -47,24 +50,21 @@ LDADD+= -ltermcap -ltelnet
DPADD+= ${LIBTERMCAP} ${LIBTELNET}
SRCS= authenc.c commands.c main.c network.c ring.c sys_bsd.c telnet.c \
terminal.c tn3270.c utilities.c
terminal.c utilities.c
# These are the sources that have encryption stuff in them.
CRYPT_SRC= authenc.c commands.c externs.h main.c network.c
CRYPT_SRC+= ring.c ring.h telnet.c terminal.c utilities.c Makefile
NOCRYPT_DIR=${.CURDIR}/Nocrypt
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/usr.bin/telnet/Makefile.frag"
.endif
CPPFLAGS+= -I${DIST}/heimdal/appl/telnet
CPPFLAGS+= -I${DIST}/heimdal/appl/telnet/telnet
CPPFLAGS+= -I${.CURDIR}/../../include/heimdal
CPPFLAGS+= -I${DESTDIR}/usr/include/kerberosIV
CPPFLAGS+= -I${DESTDIR}/usr/include/krb5
CPPFLAGS+= -I${DESTDIR}/usr/include/openssl
CPPFLAGS+= -DHAVE_CONFIG_H
CPPFLAGS+=-DIPSEC
LDADD+= -lipsec
DPADD+= ${LIBIPSEC}
CPPFLAGS+=-DINET6
LIBTELNETINCS?=-I${.CURDIR}/../../lib
CPPFLAGS+=${LIBTELNETINCS}
LDADD+= -lkrb5 -lkrb -lcrypto -lasn1 -lcom_err -lroken
.include <bsd.prog.mk>

View File

@ -1,9 +1,6 @@
# $NetBSD: Makefile,v 1.143 2000/06/13 15:15:23 itojun Exp $
# $NetBSD: Makefile,v 1.144 2000/06/20 06:00:39 thorpej Exp $
# from: @(#)Makefile 5.20 (Berkeley) 6/12/93
SRCTOP= ..
.include <bsd.crypto.mk>
SUBDIR= ac accton amd apm apmd arp bad144 bind bootp catman \
chown chroot chrtbl cnwctl config cron dbsym dev_mkdb \
dhcp diskpart dumpfs dumplfs edquota eeprom \
@ -28,8 +25,6 @@ SUBDIR+=faithd gifconfig ifmcstat mld6query mtrace6 ndp pim6dd pim6sd \
# ATM PVC
SUBDIR+=pvcsif pvctxctl
.if defined(CRYPTOPATH)
.sinclude "${CRYPTOPATH}/usr.sbin/Makefile.frag"
.endif
SUBDIR+= kadmin kstash ktutil
.include <bsd.subdir.mk>