Home | History | Annotate | only in /src/usr.sbin/wg-keygen
History log of /src/usr.sbin/wg-keygen
RevisionDateAuthorComments
 1.3 17-Dec-2025  riastradh wg-keygen(8): Find private libssh.so.

Should fix:

/usr/sbin/wg-keygen: Shared object "libssh.so.50" not found

PR lib/58648: private shared libraries should go in /usr/lib/private,
not /usr/lib
 1.2 16-Dec-2025  riastradh openssh: Install libssh.so in /usr/lib/private.

This way it doesn't get exposed to applications accidentally, and we
don't need to worry about breaking ABI when updating openssh in base.

PR lib/58648: private shared libraries should go in /usr/lib/private,
not /usr/lib
 1.1 20-Aug-2020  riastradh branches: 1.1.10;
[ozaki-r] Add wg files
 1.1.10.1 22-Jan-2026  martin Pull up following revision(s) (requested by snj in ticket #150):

distrib/sets/lists/debug/shl.mi: revision 1.380
crypto/external/bsd/openssh/lib/Makefile: revision 1.45
distrib/sets/lists/debug/shl.mi: revision 1.381
crypto/external/bsd/openssh/lib/Makefile: revision 1.46
distrib/sets/lists/debug/shl.mi: revision 1.382
distrib/evbarm/instkernel/sshramdisk/list: revision 1.7
share/mk/bsd.lib.mk: revision 1.423
share/mk/bsd.lib.mk: revision 1.425
distrib/sets/lists/comp/mi: revision 1.2503
distrib/sets/lists/comp/mi: revision 1.2504
distrib/evbarm/instkernel/sshramdisk/Makefile: revision 1.31
distrib/sets/lists/base/shl.mi: revision 1.1019
rescue/list: revision 1.56
etc/mtree/NetBSD.dist.compat.in: revision 1.9
distrib/sets/lists/debug/mi: revision 1.494
distrib/sets/lists/debug/mi: revision 1.495
distrib/sets/lists/base/mi: revision 1.1371
distrib/sets/lists/base/mi: revision 1.1372
distrib/sets/lists/comp/shl.mi: revision 1.362
etc/mtree/NetBSD.dist.base: revision 1.262
lib/libpam/modules/pam_ssh/Makefile: revision 1.15
share/mk/bsd.prog.mk: revision 1.358
share/mk/bsd.prog.mk: revision 1.359
usr.sbin/wg-keygen/Makefile: revision 1.2
usr.sbin/wg-keygen/Makefile: revision 1.3
distrib/sets/lists/base/shl.mi: revision 1.1020
share/mk/bsd.README: revision 1.457
crypto/external/bsd/openssh/Makefile.inc: revision 1.18
distrib/sets/lists/xdebug/mi: revision 1.52
rescue/Makefile: revision 1.43

Add logic for /usr/lib/private libraries.

New variables for makefiles to define:
<bsd.lib.mk> LIBSUBDIR -- If nonempty, install library into
${LIBDIR}/${LIBSUBDIR} instead of ${LIBDIR}. Typically set
either to empty or to `private'.
<bsd.lib.mk> LIBDPSUBDIRS -- List of subdirectories _subdir_ to add
-L${SHLIBDIR}/${_subdir_} -Wl,-R${SHLIBDIR}/${_subdir_} to
ldflags when linking library. Note: Should only be used inside
private libraries, not inside public libraries to link against
private libraries, which can't work -- see comment.
<bsd.prog.mk> PROGDPSUBDIRS -- List of subdirectories _subdir_ to add
-L${SHLIBDIR}/${_subdir_} -Wl,-R${SHLIBDIR}/${_subdir_} to
ldflags when linking program.

(XXX bsd.lib.mk/bsd.prog.mk should figure LIBDPSUBDIRS/PROGDPSUBDIRS
out automatically by LIBDPLIBS/PROGDPLIBS, but for now we don't have
that mechanism -- TBD in subsequent work.)

Libraries that we want to install because we use them in binaries we
ship, but that we want to keep private from applications so we don't
have to worry about ABI breakage or leakage into pkgsrc builds,
should generally set:

LIBSUBDIR= private # Install into /usr/lib/private.
NOCOMPAT= # defined # Don't build compat lib.
NOLINKLIB= # defined # Don't install .so link or .a lib.

(XXX Maybe we should have a `LIBISPRIVATE= installed' or something
for this combination of options, but for now I'm putting in the
minimal mechanism to implement this and we can condense a common
pattern later.)

Programs using the library will also have to set
PROGDPSUBDIRS+= private
so that they will get the rpath /usr/lib/private.

PR lib/58648: private shared libraries should go in /usr/lib/private,
not /usr/lib


openssh: Install libssh.so in /usr/lib/private.

This way it doesn't get exposed to applications accidentally, and we
don't need to worry about breaking ABI when updating openssh in base.
PR lib/58648: private shared libraries should go in /usr/lib/private,
not /usr/lib

openssh: Do build and install compat libssh after all.

Even though it's not exposed for applications to _link_ against, it
is used by the dynamically _loadable_ pam_ssh module, which exists as
a compat module and therefore needs libssh as a compat library to be
installed somewhere. That somewhere will be
/usr/lib/${COMPAT_ARCH}/private.

Should fix problems like:
dependall ===> compat/sparc64/sparc/../../../lib/libpam/modules/pam_ssh
nbmake[11]: don't know how to make /home/source/ab/HEAD/src/crypto/external/bsd/openssh/lib/libssh.a. Stop
Verified in an amd64 build that the compat i386 pam_ssh.so is linked
correctly:
(chroot HEAD)# ldd /usr/lib/i386/security/pam_ssh.so.4
/usr/lib/i386/security/pam_ssh.so.4:
-lssh.50 => /usr/lib/i386/private/libssh.so.50
-lcrypto.16 => /usr/lib/i386/libcrypto.so.16
-lcrypt.1 => /usr/lib/i386/libcrypt.so.1
-lgcc_s.1 => /usr/lib/i386/libgcc_s.so.1
-lc.12 => /usr/lib/i386/libc.so.12
-lz.1 => /usr/lib/i386/libz.so.1

PR lib/58648: private shared libraries should go in /usr/lib/private,
not /usr/lib


wg-keygen(8): Find private libssh.so.
Should fix:
/usr/sbin/wg-keygen: Shared object "libssh.so.50" not found
PR lib/58648: private shared libraries should go in /usr/lib/private,
not /usr/lib


evbarm/instkernel/sshramdisk: Get libssh out of objdir now.
Should fix problems like:
--- ramdiskbin.link ---
# link sshramdisk/ramdiskbin.link
/home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-tools/bin/armv6eb--netbsdelf-eabihf-gcc --sysroot=/home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-dest -static -o
ramdiskbin.link ramdiskbin.o -Wl,-rpath-link,/home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-dest/lib -L=/lib -L/home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-dest/usr/lib cat.cro
chmod.cro cp.cro dd.cro df.cro ed.cro ln.cro ls.cro mkdir.cro mv.cro pax.cro pwd.cro rm.cro rmdir.cro sh.cro stty.cro sync.cro sleep.cro chown.cro disklabel.cro fdisk.cro fsck.cro fsck_msdos.cro
fsck_ffs.cro gpt.cro ifconfig.cro init.cro mknod.cro mount.cro mount_cd9660.cro mount_ext2fs.cro mount_ffs.cro mount_kernfs.cro mount_msdos.cro mount_nfs.cro mount_tmpfs.cro newfs.cro
newfs_ext2fs.cro ping.cro reboot.cro restore.cro route.cro shutdown.cro slattach.cro swapctl.cro umount.cro ftp.cro tip.cro gzip.cro less.cro sed.cro tset.cro chroot.cro sshd.cro sysinst.cro
progress.cro dhcpcd.cro libhack.o
-ledit -lutil -lcurses -lterminfo -lrmt -lcrypt -ll -lm -lz -lprop -lssh -lcrypto -lpthread
/home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-tools/lib/gcc/armv6eb--netbsdelf-eabihf/14.3.0/../../../../armv6eb--netbsdelf-eabihf/bin/ld: cannot find -lssh: No such file or directory
/home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-tools/lib/gcc/armv6eb--netbsdelf-eabihf/14.3.0/../../../../armv6eb--netbsdelf-eabihf/bin/ld: have you installed the static version of the
ssh library ?
collect2: error: ld returned 1 exit status
*** Failed target: ramdiskbin.link
*** In directory: /home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-obj/home/source/ab/HEAD/src/distrib/evbarm/instkernel/sshramdisk
*** Failed commands:
${_MKTARGET_LINK}
=> @echo '# ' " link " sshramdisk/ramdiskbin.link
${_CCLINK.${:Uramdiskbin}} ${_LDFLAGS.${:Uramdiskbin}} ${_LDSTATIC.${:Uramdiskbin}} -o ${.TARGET} ${OBJS.${:Uramdiskbin}} ${_PROGLDOPTS} ${_LDADD.${:Uramdiskbin}}
=> /home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-tools/bin/armv6eb--netbsdelf-eabihf-gcc --sysroot=/home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-dest -static -o
ramdiskbin.link ramdiskbin.o -Wl,-rpath-link,/home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-dest/lib -L=/lib -L/home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-dest/usr/lib cat.cro
chmod.cro cp.cro dd.cro df.cro ed.cro ln.cro ls.cro mkdir.cro mv.cro pax.cro pwd.cro rm.cro rmdir.cro sh.cro stty.cro sync.cro sleep.cro chown.cro disklabel.cro fdisk.cro fsck.cro fsck_msdos.cro
fsck_ffs.cro gpt.cro ifconfig.cro init.cro mknod.cro mount.cro mount_cd9660.cro mount_ext2fs.cro mount_ffs.cro mount_kernfs.cro mount_msdos.cro mount_nfs.cro mount_tmpfs.cro newfs.cro
newfs_ext2fs.cro ping.cro reboot.cro restore.cro route.cro shutdown.cro slattach.cro swapctl.cro umount.cro ftp.cro tip.cro gzip.cro less.cro sed.cro tset.cro chroot.cro sshd.cro sysinst.cro
progress.cro dhcpcd.cro
libhack.o -ledit -lutil -lcurses -lterminfo -lrmt -lcrypt -ll -lm -lz -lprop -lssh -lcrypto -lpthread
${CTFMERGE} ${CTFMFLAGS} -o ${.TARGET} ${OBJS.${:Uramdiskbin}}
=> /home/builds/ab/HEAD/evbarm-earmv6hfeb/20251217070550Z-tools/bin/nbctfmerge -t -g -L VERSION -g -o ramdiskbin.link ramdiskbin.o
*** [ramdiskbin.link] Error code 1
PR lib/58648: private shared libraries should go in
/usr/lib/private, not /usr/lib


distrib/sets/lists/comp: libssh is private for lint too.
Might fix:
checkflist ===> distrib/sets
====== 1 missing files in DESTDIR ========
Files in flist but missing from DESTDIR.
File wasn't installed ?
------------------------------------------
./usr/libdata/lint/llib-lssh.ln
======== end of 1 missing files ==========
PR lib/58648: private shared libraries should go in /usr/lib/private,
not /usr/lib

PR/58648: Fix MKDEBUG=yes build:
1. if NOLINKLIB is set don't install libfoo_g.a and libfoo_p.a libraries.
libfoo.a, libfoo_p.a were not being installed already, just make the
testing consistent
2. Move .a libraries from shl.mi to mi where they belong.
3. Make stray libfoo_g.a libraries that were install accidentally before
obsolete.

rescue/list: Touch for CRUNCHGEN_FLAGS change for libssh.
PR lib/58648: private shared libraries should go in /usr/lib/private,
not /usr/lib
 1.4 23-Feb-2025  uwe wg-keygen(8): fix SYNOPSIS formatting

Don't cram the flags into the invocation of .Nm - this seems to
confuse mdoc. Pointed out by bad@
 1.3 26-Aug-2020  riastradh branches: 1.3.8;
Clarify wg(4)'s relation to WireGuard, pending further discussion.

Still planning to replace wgconfig(8) and wg-keygen(8) by one wg(8)
tool compatible with wireguard-tools; update wg(4) for the minor
changes from the 2018-06-30 spec to the 2020-06-01 spec; &c. This just
clarifies the current state of affairs as it exists in the development
tree for now.

Mark the man page EXPERIMENTAL for extra clarity.
 1.2 20-Aug-2020  riastradh Fill out WireGuard man pages.
 1.1 20-Aug-2020  riastradh [ozaki-r] Add wg files
 1.3.8.1 02-Aug-2025  perseant Sync with HEAD
 1.1 20-Aug-2020  riastradh [ozaki-r] Add wg files

RSS XML Feed