Some more changes to crypto/external/bsd/netpgp missed in last commit
This commit is contained in:
parent
f9f0ad010f
commit
f238ccc5e5
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.13 2014/12/05 04:42:36 agc Exp $
|
||||
# $NetBSD: Makefile,v 1.15 2017/04/17 19:50:27 agc Exp $
|
||||
|
||||
PROG=netpgpverify
|
||||
BINDIR= /usr/bin
|
||||
|
|
@ -9,7 +9,7 @@ SRCS+= pgpsum.c rsa.c
|
|||
|
||||
SRCS+= bzlib.c zlib.c
|
||||
|
||||
SRCS+= md5c.c rmd160.c sha1.c sha2.c tiger.c
|
||||
SRCS+= md5c.c rmd160.c sha1.c sha2.c
|
||||
|
||||
CPPFLAGS+=-I${.CURDIR} -I${EXTDIST}/src/netpgpverify
|
||||
COPTS.libverify.c+= -Wno-format-nonliteral
|
||||
|
|
@ -36,3 +36,5 @@ t tst: ${PROG}
|
|||
./${PROG} -S ${EXTDIST}/src/netpgpverify/sshtest-20140202.pub ${EXTDIST}/src/netpgpverify/data.sig
|
||||
@echo "expected failure, to check bad signatures fail to verify"
|
||||
-sed -e 's|A|B|' ${EXTDIST}/src/netpgpverify/data.gpg | ./${PROG} -S ${EXTDIST}/src/netpgpverify/sshtest-20140202.pub
|
||||
@echo "testing signatures with no version"
|
||||
./${PROG} -k ${EXTDIST}/src/netpgpverify/pubring.gpg ${EXTDIST}/src/netpgpverify/noversion.asc
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
337
crypto/external/bsd/netpgp/dist/buildaux/config.sub
vendored
337
crypto/external/bsd/netpgp/dist/buildaux/config.sub
vendored
|
|
@ -1,44 +1,40 @@
|
|||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright 1992-2017 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2008-09-08'
|
||||
timestamp='2017-01-01'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
# the same distribution terms that you use for the rest of that
|
||||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
# Please send patches to <config-patches@gnu.org>.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
|
||||
|
||||
# This file is supposed to be the same for all GNU packages
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
# that are meaningful with *any* GNU software.
|
||||
|
|
@ -57,8 +53,7 @@ timestamp='2008-09-08'
|
|||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION] CPU-MFR-OPSYS
|
||||
$0 [OPTION] ALIAS
|
||||
Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
|
||||
|
||||
Canonicalize a configuration name.
|
||||
|
||||
|
|
@ -72,8 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
Copyright 1992-2017 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
|
@ -120,12 +114,18 @@ esac
|
|||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
|
||||
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
|
||||
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
|
||||
kopensolaris*-gnu* | cloudabi*-eabi* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
android-linux)
|
||||
os=-linux-android
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
|
||||
;;
|
||||
*)
|
||||
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
|
||||
if [ $basic_machine != $1 ]
|
||||
|
|
@ -148,10 +148,13 @@ case $os in
|
|||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis | -knuth | -cray)
|
||||
-apple | -axis | -knuth | -cray | -microblaze*)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-bluegene*)
|
||||
os=-cnk
|
||||
;;
|
||||
-sim | -cisco | -oki | -wec | -winbond)
|
||||
os=
|
||||
basic_machine=$1
|
||||
|
|
@ -214,6 +217,12 @@ case $os in
|
|||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*178)
|
||||
os=-lynxos178
|
||||
;;
|
||||
-lynx*5)
|
||||
os=-lynxos5
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
;;
|
||||
|
|
@ -238,19 +247,29 @@ case $basic_machine in
|
|||
# Some are omitted here because they have special meanings below.
|
||||
1750a | 580 \
|
||||
| a29k \
|
||||
| aarch64 | aarch64_be \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| arc | arceb \
|
||||
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
||||
| avr | avr32 \
|
||||
| ba \
|
||||
| be32 | be64 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| c4x | c8051 | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fido | fr30 | frv \
|
||||
| e2k | epiphany \
|
||||
| fido | fr30 | frv | ft32 \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| hexagon \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| k1om \
|
||||
| le32 | le64 \
|
||||
| lm32 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep | metag \
|
||||
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
|
|
@ -264,35 +283,56 @@ case $basic_machine in
|
|||
| mips64vr5900 | mips64vr5900el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa32r6 | mipsisa32r6el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64r6 | mipsisa64r6el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipsr5900 | mipsr5900el \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nios | nios2 \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nios | nios2 | nios2eb | nios2el \
|
||||
| ns16k | ns32k \
|
||||
| or32 \
|
||||
| open8 | or1k | or1knd | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||
| pru \
|
||||
| pyramid \
|
||||
| riscv32 | riscv64 \
|
||||
| rl78 | rx \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| spu | strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| spu \
|
||||
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
|
||||
| ubicom32 \
|
||||
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
|
||||
| visium \
|
||||
| we32k \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| x86 | xc16x | xstormy16 | xtensa \
|
||||
| z8k | z80)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
# Motorola 68HC11/12.
|
||||
c54x)
|
||||
basic_machine=tic54x-unknown
|
||||
;;
|
||||
c55x)
|
||||
basic_machine=tic55x-unknown
|
||||
;;
|
||||
c6x)
|
||||
basic_machine=tic6x-unknown
|
||||
;;
|
||||
leon|leon[3-9])
|
||||
basic_machine=sparc-$basic_machine
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
|
|
@ -302,6 +342,21 @@ case $basic_machine in
|
|||
basic_machine=mt-unknown
|
||||
;;
|
||||
|
||||
strongarm | thumb | xscale)
|
||||
basic_machine=arm-unknown
|
||||
;;
|
||||
xgate)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
xscaleeb)
|
||||
basic_machine=armeb-unknown
|
||||
;;
|
||||
|
||||
xscaleel)
|
||||
basic_machine=armel-unknown
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
|
|
@ -316,24 +371,32 @@ case $basic_machine in
|
|||
# Recognize the basic CPU types with company name.
|
||||
580-* \
|
||||
| a29k-* \
|
||||
| aarch64-* | aarch64_be-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* | avr32-* \
|
||||
| ba-* \
|
||||
| be32-* | be64-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
||||
| c8051-* | clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| e2k-* | elxsi-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| hexagon-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| k1om-* \
|
||||
| le32-* | le64-* \
|
||||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||
| microblaze-* | microblazeel-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
|
|
@ -347,32 +410,44 @@ case $basic_machine in
|
|||
| mips64vr5900-* | mips64vr5900el-* \
|
||||
| mipsisa32-* | mipsisa32el-* \
|
||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||
| mipsisa32r6-* | mipsisa32r6el-* \
|
||||
| mipsisa64-* | mipsisa64el-* \
|
||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64r6-* | mipsisa64r6el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipsr5900-* | mipsr5900el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nios-* | nios2-* \
|
||||
| nds32-* | nds32le-* | nds32be-* \
|
||||
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| open8-* \
|
||||
| or1k*-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
||||
| pru-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| riscv32-* | riscv64-* \
|
||||
| rl78-* | romp-* | rs6000-* | rx-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
|
||||
| tahoe-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tile*-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| ubicom32-* \
|
||||
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
|
||||
| vax-* \
|
||||
| visium-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
| ymp-* \
|
||||
| z8k-* | z80-*)
|
||||
|
|
@ -443,6 +518,13 @@ case $basic_machine in
|
|||
basic_machine=m68k-apollo
|
||||
os=-bsd
|
||||
;;
|
||||
aros)
|
||||
basic_machine=i386-pc
|
||||
os=-aros
|
||||
;;
|
||||
asmjs)
|
||||
basic_machine=asmjs-unknown
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
|
|
@ -459,6 +541,19 @@ case $basic_machine in
|
|||
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
bluegene*)
|
||||
basic_machine=powerpc-ibm
|
||||
os=-cnk
|
||||
;;
|
||||
c54x-*)
|
||||
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c55x-*)
|
||||
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c6x-*)
|
||||
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
|
|
@ -495,7 +590,7 @@ case $basic_machine in
|
|||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16)
|
||||
cr16 | cr16-*)
|
||||
basic_machine=cr16-unknown
|
||||
os=-elf
|
||||
;;
|
||||
|
|
@ -550,6 +645,14 @@ case $basic_machine in
|
|||
basic_machine=m68k-bull
|
||||
os=-sysv3
|
||||
;;
|
||||
e500v[12])
|
||||
basic_machine=powerpc-unknown
|
||||
os=$os"spe"
|
||||
;;
|
||||
e500v[12]-*)
|
||||
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=$os"spe"
|
||||
;;
|
||||
ebmon29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-ebmon
|
||||
|
|
@ -653,7 +756,6 @@ case $basic_machine in
|
|||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i*86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
|
|
@ -692,6 +794,9 @@ case $basic_machine in
|
|||
basic_machine=m68k-isi
|
||||
os=-sysv
|
||||
;;
|
||||
leon-*|leon[3-9]-*)
|
||||
basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
|
||||
;;
|
||||
m68knommu)
|
||||
basic_machine=m68k-unknown
|
||||
os=-linux
|
||||
|
|
@ -711,8 +816,15 @@ case $basic_machine in
|
|||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
microblaze*)
|
||||
basic_machine=microblaze-xilinx
|
||||
;;
|
||||
mingw64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-mingw64
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
basic_machine=i686-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
|
|
@ -740,6 +852,10 @@ case $basic_machine in
|
|||
basic_machine=powerpc-unknown
|
||||
os=-morphos
|
||||
;;
|
||||
moxiebox)
|
||||
basic_machine=moxie-unknown
|
||||
os=-moxiebox
|
||||
;;
|
||||
msdos)
|
||||
basic_machine=i386-pc
|
||||
os=-msdos
|
||||
|
|
@ -747,10 +863,18 @@ case $basic_machine in
|
|||
ms1-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
msys)
|
||||
basic_machine=i686-pc
|
||||
os=-msys
|
||||
;;
|
||||
mvs)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
nacl)
|
||||
basic_machine=le32-unknown
|
||||
os=-nacl
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
|
|
@ -815,6 +939,12 @@ case $basic_machine in
|
|||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
neo-tandem)
|
||||
basic_machine=neo-tandem
|
||||
;;
|
||||
nse-tandem)
|
||||
basic_machine=nse-tandem
|
||||
;;
|
||||
nsr-tandem)
|
||||
basic_machine=nsr-tandem
|
||||
;;
|
||||
|
|
@ -897,11 +1027,12 @@ case $basic_machine in
|
|||
;;
|
||||
power) basic_machine=power-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
ppc | ppcbe) basic_machine=powerpc-unknown
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
ppc-* | ppcbe-*)
|
||||
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
ppcle | powerpclittle)
|
||||
basic_machine=powerpcle-unknown
|
||||
;;
|
||||
ppcle-* | powerpclittle-*)
|
||||
|
|
@ -911,7 +1042,7 @@ case $basic_machine in
|
|||
;;
|
||||
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
||||
ppc64le | powerpc64little)
|
||||
basic_machine=powerpc64le-unknown
|
||||
;;
|
||||
ppc64le-* | powerpc64little-*)
|
||||
|
|
@ -924,7 +1055,11 @@ case $basic_machine in
|
|||
basic_machine=i586-unknown
|
||||
os=-pw32
|
||||
;;
|
||||
rdos)
|
||||
rdos | rdos64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-rdos
|
||||
;;
|
||||
rdos32)
|
||||
basic_machine=i386-pc
|
||||
os=-rdos
|
||||
;;
|
||||
|
|
@ -993,6 +1128,9 @@ case $basic_machine in
|
|||
basic_machine=i860-stratus
|
||||
os=-sysv4
|
||||
;;
|
||||
strongarm-* | thumb-*)
|
||||
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
|
|
@ -1049,20 +1187,8 @@ case $basic_machine in
|
|||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tic54x | c54x*)
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic55x | c55x*)
|
||||
basic_machine=tic55x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic6x | c6x*)
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tile*)
|
||||
basic_machine=tile-unknown
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tx39)
|
||||
|
|
@ -1132,6 +1258,9 @@ case $basic_machine in
|
|||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
xscale-* | xscalee[bl]-*)
|
||||
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
|
||||
;;
|
||||
ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
|
|
@ -1182,7 +1311,7 @@ case $basic_machine in
|
|||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
|
||||
|
|
@ -1232,6 +1361,9 @@ case $os in
|
|||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-auroraux)
|
||||
os=-auroraux
|
||||
;;
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
;;
|
||||
|
|
@ -1252,29 +1384,32 @@ case $os in
|
|||
# Each alternative MUST END IN A *, to match a version number.
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* | -plan9* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* \
|
||||
| -aos* | -aros* | -cloudabi* | -sortix* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -openbsd* | -solidbsd* \
|
||||
| -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
|
||||
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
|
||||
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
|
||||
| -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
|
|
@ -1398,15 +1533,16 @@ case $os in
|
|||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
-dicos*)
|
||||
os=-dicos
|
||||
;;
|
||||
-nacl*)
|
||||
;;
|
||||
-ios)
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
|
|
@ -1447,6 +1583,21 @@ case $basic_machine in
|
|||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
c8051-*)
|
||||
os=-elf
|
||||
;;
|
||||
hexagon-*)
|
||||
os=-elf
|
||||
;;
|
||||
tic54x-*)
|
||||
os=-coff
|
||||
;;
|
||||
tic55x-*)
|
||||
os=-coff
|
||||
;;
|
||||
tic6x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
|
|
@ -1465,9 +1616,6 @@ case $basic_machine in
|
|||
;;
|
||||
m68000-sun)
|
||||
os=-sunos3
|
||||
# This also exists in the configure program, but was not the
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
|
|
@ -1490,6 +1638,9 @@ case $basic_machine in
|
|||
sparc-* | *-sun)
|
||||
os=-sunos4.1.1
|
||||
;;
|
||||
pru-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-be)
|
||||
os=-beos
|
||||
;;
|
||||
|
|
@ -1604,7 +1755,7 @@ case $basic_machine in
|
|||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-aix*)
|
||||
-cnk*|-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-beos*)
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
#if defined(__NetBSD__)
|
||||
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: keyring.c,v 1.50 2011/06/25 00:37:44 agc Exp $");
|
||||
__RCSID("$NetBSD: keyring.c,v 1.55 2017/03/27 21:19:12 khorben Exp $");
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
|
|
@ -214,7 +214,7 @@ pgp_get_writable_seckey(pgp_key_t *data)
|
|||
|
||||
/* utility function to zero out memory */
|
||||
void
|
||||
pgp_forget(void *vp, unsigned size)
|
||||
pgp_forget(void *vp, size_t size)
|
||||
{
|
||||
(void) memset(vp, 0x0, size);
|
||||
}
|
||||
|
|
@ -244,9 +244,11 @@ decrypt_cb(const pgp_packet_t *pkt, pgp_cbdata_t *cbinfo)
|
|||
break;
|
||||
|
||||
case PGP_GET_PASSPHRASE:
|
||||
(void) pgp_getpassphrase(decrypt->passfp, pass, sizeof(pass));
|
||||
if (pgp_getpassphrase(decrypt->passfp, pass, sizeof(pass)) == 0) {
|
||||
pass[0] = '\0';
|
||||
}
|
||||
*content->skey_passphrase.passphrase = netpgp_strdup(pass);
|
||||
pgp_forget(pass, (unsigned)sizeof(pass));
|
||||
pgp_forget(pass, sizeof(pass));
|
||||
return PGP_KEEP_MEMORY;
|
||||
|
||||
case PGP_PARSER_ERRCODE:
|
||||
|
|
@ -292,6 +294,20 @@ decrypt_cb(const pgp_packet_t *pkt, pgp_cbdata_t *cbinfo)
|
|||
return PGP_RELEASE_MEMORY;
|
||||
}
|
||||
|
||||
static pgp_cb_ret_t
|
||||
decrypt_cb_empty(const pgp_packet_t *pkt, pgp_cbdata_t *cbinfo)
|
||||
{
|
||||
const pgp_contents_t *content = &pkt->u;
|
||||
|
||||
switch (pkt->tag) {
|
||||
case PGP_GET_PASSPHRASE:
|
||||
*content->skey_passphrase.passphrase = netpgp_strdup("");
|
||||
return PGP_KEEP_MEMORY;
|
||||
default:
|
||||
return decrypt_cb(pkt, cbinfo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
\ingroup Core_Keys
|
||||
\brief Decrypts secret key from given keydata with given passphrase
|
||||
|
|
@ -300,14 +316,24 @@ decrypt_cb(const pgp_packet_t *pkt, pgp_cbdata_t *cbinfo)
|
|||
\return secret key
|
||||
*/
|
||||
pgp_seckey_t *
|
||||
pgp_decrypt_seckey(const pgp_key_t *key, void *passfp)
|
||||
pgp_decrypt_seckey(const pgp_key_t *key, FILE *passfp)
|
||||
{
|
||||
pgp_stream_t *stream;
|
||||
const int printerrors = 1;
|
||||
decrypt_t decrypt;
|
||||
|
||||
/* XXX first try with an empty passphrase */
|
||||
(void) memset(&decrypt, 0x0, sizeof(decrypt));
|
||||
decrypt.key = key;
|
||||
stream = pgp_new(sizeof(*stream));
|
||||
pgp_keydata_reader_set(stream, key);
|
||||
pgp_set_callback(stream, decrypt_cb_empty, &decrypt);
|
||||
stream->readinfo.accumulate = 1;
|
||||
pgp_parse(stream, !printerrors);
|
||||
if (decrypt.seckey != NULL) {
|
||||
return decrypt.seckey;
|
||||
}
|
||||
/* ask for a passphrase */
|
||||
decrypt.passfp = passfp;
|
||||
stream = pgp_new(sizeof(*stream));
|
||||
pgp_keydata_reader_set(stream, key);
|
||||
|
|
@ -993,9 +1019,12 @@ pgp_keyring_list(pgp_io_t *io, const pgp_keyring_t *keyring, const int psigs)
|
|||
{
|
||||
pgp_key_t *key;
|
||||
unsigned n;
|
||||
unsigned keyc = (keyring != NULL) ? keyring->keyc : 0;
|
||||
|
||||
(void) fprintf(io->res, "%u key%s\n", keyring->keyc,
|
||||
(keyring->keyc == 1) ? "" : "s");
|
||||
(void) fprintf(io->res, "%u key%s\n", keyc, (keyc == 1) ? "" : "s");
|
||||
if (keyring == NULL) {
|
||||
return 1;
|
||||
}
|
||||
for (n = 0, key = keyring->keys; n < keyring->keyc; ++n, ++key) {
|
||||
if (pgp_is_key_secret(key)) {
|
||||
pgp_print_keydata(io, keyring, key, "sec",
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
#ifndef KEYRING_H_
|
||||
#define KEYRING_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include "packet.h"
|
||||
#include "packet-parse.h"
|
||||
#include "mj.h"
|
||||
|
|
@ -91,7 +92,7 @@ const pgp_pubkey_t *pgp_get_pubkey(const pgp_key_t *);
|
|||
unsigned pgp_is_key_secret(const pgp_key_t *);
|
||||
const pgp_seckey_t *pgp_get_seckey(const pgp_key_t *);
|
||||
pgp_seckey_t *pgp_get_writable_seckey(pgp_key_t *);
|
||||
pgp_seckey_t *pgp_decrypt_seckey(const pgp_key_t *, void *);
|
||||
pgp_seckey_t *pgp_decrypt_seckey(const pgp_key_t *, FILE *);
|
||||
|
||||
unsigned pgp_keyring_fileread(pgp_keyring_t *, const unsigned,
|
||||
const char *);
|
||||
|
|
@ -100,7 +101,7 @@ int pgp_keyring_list(pgp_io_t *, const pgp_keyring_t *, const int);
|
|||
int pgp_keyring_json(pgp_io_t *, const pgp_keyring_t *, mj_t *, const int);
|
||||
|
||||
void pgp_set_seckey(pgp_contents_t *, const pgp_key_t *);
|
||||
void pgp_forget(void *, unsigned);
|
||||
void pgp_forget(void *, size_t);
|
||||
|
||||
const uint8_t *pgp_get_key_id(const pgp_key_t *);
|
||||
unsigned pgp_get_userid_count(const pgp_key_t *);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: libnetpgp.3,v 1.16 2014/02/17 07:23:18 agc Exp $
|
||||
.\" $NetBSD: libnetpgp.3,v 1.16.18.1 2018/05/06 09:47:47 martin Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2009,2010 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd February 16, 2014
|
||||
.Dd April 29, 2018
|
||||
.Dt LIBNETPGP 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -79,6 +79,10 @@ The following functions are for variable management:
|
|||
.Fo netpgp_incvar
|
||||
.Fa "netpgp_t *netpgp" "const char *name" "const int delta"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_unsetvar
|
||||
.Fa "netpgp_t *netpgp" "const char *name"
|
||||
.Fc
|
||||
.Pp
|
||||
The following function sets the home directory:
|
||||
.Ft int
|
||||
|
|
@ -92,8 +96,20 @@ The following functions are used for key management:
|
|||
.Fa "netpgp_t *netpgp" "const int printsigs"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_match_list_keys
|
||||
.Fa "netpgp_t *netpgp" "char *pattern"
|
||||
.Fo netpgp_list_keys_json
|
||||
.Fa "netpgp_t *netpgp" "char **json" "const int psigs"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_match_keys
|
||||
.Fa "netpgp_t *netpgp" "char *name" "const char *fmt" "void *vp" "const int psigs"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_match_keys_json
|
||||
.Fa "netpgp_t *netpgp" "char **json" "char *name" "const char *fmt" "const int psigs"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_match_pubkeys
|
||||
.Fa "netpgp_t *netpgp" "char *name" "void *vp"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_find_key
|
||||
|
|
@ -101,7 +117,7 @@ The following functions are used for key management:
|
|||
.Fc
|
||||
.Ft char *
|
||||
.Fo netpgp_get_key
|
||||
.Fa "netpgp_t *netpgp" "const char *id"
|
||||
.Fa "netpgp_t *netpgp" "const char *name" "const char *fmt"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_export_key
|
||||
|
|
@ -115,31 +131,39 @@ The following functions are used for key management:
|
|||
.Fo netpgp_generate_key
|
||||
.Fa "netpgp_t *netpgp" "char *userid" "int numbits"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_validate_sigs
|
||||
.Fa "netpgp_t *netpgp"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_format_json
|
||||
.Fa "void *vp" "const char *json" "const int psigs"
|
||||
.Fc
|
||||
.Pp
|
||||
The following functions are used for file management:
|
||||
.Ft int
|
||||
.Fo netpgp_encrypt_file
|
||||
.Fa "netpgp_t *netpgp" "char *userid" "char *filename" "char *out"
|
||||
.Fa "netpgp_t *netpgp" "const char *userid" "const char *filename" "char *out"
|
||||
.Fa "int armored"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_decrypt_file
|
||||
.Fa "netpgp_t *netpgp" "char *filename" "char *out" "int armored"
|
||||
.Fa "netpgp_t *netpgp" "const char *filename" "char *out" "int armored"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_sign_file
|
||||
.Fa "netpgp_t *netpgp" "char *userid" "char *filename" "char *out"
|
||||
.Fa "netpgp_t *netpgp" "const char *userid" "const char *filename" "char *out"
|
||||
.Fa "int armored" "int cleartext" "int detached"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo netpgp_verify_file
|
||||
.Fa "netpgp_t *netpgp" "char *f" "int armored"
|
||||
.Fa "netpgp_t *netpgp" "const char *in" "const char *out" "int armored"
|
||||
.Fc
|
||||
.Pp
|
||||
The following functions are used for memory signing and encryption:
|
||||
.Ft int
|
||||
.Fo netpgp_encrypt_memory
|
||||
.Fa "netpgp_t *netpgp" "char *userid" "void *in" "const size_t insize"
|
||||
.Fa "netpgp_t *netpgp" "const char *userid" "void *in" "const size_t insize"
|
||||
.Fa "char *out" "size_t outsize" "int armored"
|
||||
.Fc
|
||||
.Ft int
|
||||
|
|
@ -172,12 +196,13 @@ Normal operation sees the
|
|||
.Nm
|
||||
process be initialised using the
|
||||
.Fn netpgp_init
|
||||
function, which will set up the public and private keyrings, and set the
|
||||
user identity to the
|
||||
function, which will set up the public and private keyrings, as well as set the
|
||||
user identity in the
|
||||
.Ar userid
|
||||
argument passed stored in the
|
||||
member of the
|
||||
.Dv netpgp_t
|
||||
structure, and set using the
|
||||
structure.
|
||||
These are set using the
|
||||
.Fn netpgp_setvar
|
||||
function.
|
||||
If no public key ring file is set, initial values will be taken from those
|
||||
|
|
@ -189,6 +214,13 @@ initial values will be taken from those
|
|||
in the
|
||||
.Pa .gnupg/secring.gpg
|
||||
file in the user's home directory.
|
||||
The user identity is obtained from the
|
||||
.Ev userid
|
||||
environment variable, or failing that, the value of the
|
||||
.Dq default-key
|
||||
setting from
|
||||
.Pa .gnupg/gpg.conf
|
||||
file in the user's home directory is used.
|
||||
The
|
||||
.Fn netpgp_init
|
||||
function returns 1 on success, 0 on failure.
|
||||
|
|
@ -198,13 +230,6 @@ To list all the keys in a keyring, the
|
|||
function is used.
|
||||
The signature subkey fields can also be displayed
|
||||
using this function.
|
||||
The
|
||||
.Fn netpgp_match_list_keys
|
||||
function is used to match (via regular expression)
|
||||
a subset of the keys in the keyring.
|
||||
If the expression to match is NULL,
|
||||
the search will degenerate into a
|
||||
listing of all keys in the keyring.
|
||||
.Pp
|
||||
The home directory is specified as an internal variable,
|
||||
and its existence is checked using the
|
||||
|
|
@ -223,13 +248,13 @@ Output is sent to the standard output.
|
|||
.Pp
|
||||
To import a key onto the public keyring, the
|
||||
.Fn netpgp_import_key
|
||||
is used.
|
||||
function is used.
|
||||
The name of the file containing the key to be imported is provided
|
||||
as the filename argument.
|
||||
.Pp
|
||||
To generate a key, the
|
||||
.Fn netpgp_generate_key
|
||||
is used.
|
||||
function is used.
|
||||
It takes an argument of the number of bits to use in the key.
|
||||
At the time that this manual page was created (April 2009),
|
||||
the recommendations are that the bare minimum key size
|
||||
|
|
|
|||
27
crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
vendored
27
crypto/external/bsd/netpgp/dist/src/lib/netpgp.c
vendored
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
#if defined(__NetBSD__)
|
||||
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: netpgp.c,v 1.96 2012/02/22 06:58:54 agc Exp $");
|
||||
__RCSID("$NetBSD: netpgp.c,v 1.101 2017/03/27 20:55:13 khorben Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
|
@ -1186,6 +1186,7 @@ netpgp_generate_key(netpgp_t *netpgp, char *id, int numbits)
|
|||
int passc;
|
||||
int fd;
|
||||
int cc;
|
||||
int rv = 0;
|
||||
|
||||
uid = NULL;
|
||||
io = netpgp->io;
|
||||
|
|
@ -1212,13 +1213,13 @@ netpgp_generate_key(netpgp_t *netpgp, char *id, int numbits)
|
|||
netpgp_setvar(netpgp, "generated userid", &dir[cc - 16]);
|
||||
if (mkdir(dir, 0700) < 0) {
|
||||
(void) fprintf(io->errs, "can't mkdir '%s'\n", dir);
|
||||
return 0;
|
||||
goto out;
|
||||
}
|
||||
(void) fprintf(io->errs, "netpgp: generated keys in directory %s\n", dir);
|
||||
(void) snprintf(ringfile = filename, sizeof(filename), "%s/pubring.gpg", dir);
|
||||
if (!appendkey(io, key, ringfile)) {
|
||||
(void) fprintf(io->errs, "Cannot write pubkey to '%s'\n", ringfile);
|
||||
return 0;
|
||||
goto out;
|
||||
}
|
||||
if (netpgp->pubring != NULL) {
|
||||
pgp_keyring_free(netpgp->pubring);
|
||||
|
|
@ -1230,7 +1231,7 @@ netpgp_generate_key(netpgp_t *netpgp, char *id, int numbits)
|
|||
}
|
||||
if (fd < 0) {
|
||||
(void) fprintf(io->errs, "can't append secring '%s'\n", ringfile);
|
||||
return 0;
|
||||
goto out;
|
||||
}
|
||||
/* get the passphrase */
|
||||
if ((numtries = netpgp_getvar(netpgp, "numtries")) == NULL ||
|
||||
|
|
@ -1242,15 +1243,18 @@ netpgp_generate_key(netpgp_t *netpgp, char *id, int numbits)
|
|||
passc = find_passphrase(netpgp->passfp, &cp[ID_OFFSET], passphrase, sizeof(passphrase), attempts);
|
||||
if (!pgp_write_xfer_seckey(create, key, (uint8_t *)passphrase, (const unsigned)passc, noarmor)) {
|
||||
(void) fprintf(io->errs, "Cannot write seckey\n");
|
||||
return 0;
|
||||
goto out1;
|
||||
}
|
||||
rv = 1;
|
||||
out1:
|
||||
pgp_teardown_file_write(create, fd);
|
||||
if (netpgp->secring != NULL) {
|
||||
pgp_keyring_free(netpgp->secring);
|
||||
}
|
||||
out:
|
||||
pgp_keydata_free(key);
|
||||
free(cp);
|
||||
return 1;
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* encrypt a file */
|
||||
|
|
@ -1407,7 +1411,7 @@ netpgp_sign_file(netpgp_t *netpgp,
|
|||
(unsigned)armored, (unsigned)cleartext,
|
||||
overwrite);
|
||||
}
|
||||
pgp_forget(seckey, (unsigned)sizeof(*seckey));
|
||||
pgp_forget(seckey, sizeof(*seckey));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -1501,11 +1505,18 @@ netpgp_sign_memory(netpgp_t *netpgp,
|
|||
&pubkey->key.pubkey, 0);
|
||||
}
|
||||
}
|
||||
if (netpgp_getvar(netpgp, "ssh keys") == NULL) {
|
||||
/* now decrypt key */
|
||||
seckey = pgp_decrypt_seckey(keypair, netpgp->passfp);
|
||||
if (seckey == NULL) {
|
||||
(void) fprintf(io->errs, "Bad passphrase\n");
|
||||
}
|
||||
} else {
|
||||
pgp_keyring_t *secring;
|
||||
|
||||
secring = netpgp->secring;
|
||||
seckey = &secring->keys[0].key.seckey;
|
||||
}
|
||||
}
|
||||
if (seckey == NULL) {
|
||||
(void) fprintf(io->errs, "Bad passphrase\n");
|
||||
|
|
@ -1531,7 +1542,7 @@ netpgp_sign_memory(netpgp_t *netpgp,
|
|||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
pgp_forget(seckey, (unsigned)sizeof(*seckey));
|
||||
pgp_forget(seckey, sizeof(*seckey));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
|
||||
#if defined(__NetBSD__)
|
||||
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: reader.c,v 1.49 2012/03/05 02:20:18 christos Exp $");
|
||||
__RCSID("$NetBSD: reader.c,v 1.52 2017/03/27 20:50:19 khorben Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
|
@ -160,6 +160,7 @@ int
|
|||
pgp_getpassphrase(void *in, char *phrase, size_t size)
|
||||
{
|
||||
char *p;
|
||||
size_t len;
|
||||
|
||||
if (in == NULL) {
|
||||
while ((p = getpass("netpgp passphrase: ")) == NULL) {
|
||||
|
|
@ -169,7 +170,10 @@ pgp_getpassphrase(void *in, char *phrase, size_t size)
|
|||
if (fgets(phrase, (int)size, in) == NULL) {
|
||||
return 0;
|
||||
}
|
||||
phrase[strlen(phrase) - 1] = 0x0;
|
||||
len = strlen(phrase);
|
||||
if (len >= 1 && phrase[len - 1] == '\n') {
|
||||
phrase[len - 1] = '\0';
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
#if defined(__NetBSD__)
|
||||
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: signature.c,v 1.34 2012/03/05 02:20:18 christos Exp $");
|
||||
__RCSID("$NetBSD: signature.c,v 1.37 2017/04/09 23:03:50 khorben Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
|
@ -903,9 +903,13 @@ open_output_file(pgp_output_t **output,
|
|||
|
||||
/* setup output file */
|
||||
if (outname) {
|
||||
fd = pgp_setup_file_write(output, outname, overwrite);
|
||||
if (strcmp(outname, "-") == 0) {
|
||||
fd = pgp_setup_file_write(output, NULL, overwrite);
|
||||
} else {
|
||||
unsigned flen = (unsigned)(strlen(inname) + 4 + 1);
|
||||
fd = pgp_setup_file_write(output, outname, overwrite);
|
||||
}
|
||||
} else {
|
||||
size_t flen = strlen(inname) + 1 + strlen(suffix) + 1;
|
||||
char *f = NULL;
|
||||
|
||||
if ((f = calloc(1, flen)) == NULL) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: libnetpgpbn.3,v 1.4 2014/02/17 07:23:18 agc Exp $
|
||||
.\" $NetBSD: libnetpgpbn.3,v 1.4.18.1 2018/05/06 09:47:47 martin Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2010 Alistair Crooks <agc@NetBSD.org>
|
||||
.\" All rights reserved.
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd February 16, 2014
|
||||
.Dd April 3, 2018
|
||||
.Dt LIBNETPGPBN 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -257,7 +257,7 @@ in the
|
|||
buffer called
|
||||
.Va buf
|
||||
where
|
||||
.Dq USERNAME
|
||||
.Dq USER
|
||||
is the name of the user taken from the runtime environment.
|
||||
The encoded text will be in an allocated buffer called
|
||||
.Va s .
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: libmj.3,v 1.7 2014/02/17 07:23:18 agc Exp $
|
||||
.\" $NetBSD: libmj.3,v 1.7.18.1 2018/05/06 09:47:47 martin Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2010 Alistair Crooks <agc@NetBSD.org>
|
||||
.\" All rights reserved.
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd February 16, 2014
|
||||
.Dd April 3, 2018
|
||||
.Dt LIBMJ 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -227,10 +227,10 @@ in the
|
|||
buffer called
|
||||
.Va buf
|
||||
where
|
||||
.Dq USERNAME
|
||||
.Dq USER
|
||||
is the name of the user taken from the runtime environment.
|
||||
The encoded text will be in an allocated buffer called
|
||||
.Va s
|
||||
.Va s .
|
||||
.Bd -literal -offset indent
|
||||
mj_t atom;
|
||||
char buf[BUFSIZ];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: netpgp.1,v 1.19 2014/02/17 07:23:18 agc Exp $
|
||||
.\" $NetBSD: netpgp.1,v 1.21 2017/03/27 21:34:32 khorben Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
|
|
@ -203,7 +203,7 @@ library.
|
|||
In addition to one of the preceding commands, a number of qualifiers
|
||||
or options may be given.
|
||||
.Bl -tag -width Ar
|
||||
.It Fl Fl armour , Fl armor
|
||||
.It Fl Fl armour , Fl Fl armor
|
||||
This option, however it is spelled, wraps the signature as an
|
||||
ASCII-encoded piece of text, for ease of use.
|
||||
.It Fl Fl cipher Ar ciphername
|
||||
|
|
@ -216,7 +216,7 @@ access to the cipher used.
|
|||
The default cipher algorithm is the
|
||||
.Dq CAST5
|
||||
algorithm.
|
||||
.It Fl Fl detached
|
||||
.It Fl Fl detach , Fl Fl detached
|
||||
When signing a file, place the resulting signature in a separate
|
||||
file from the one being signed.
|
||||
.It Fl Fl hash-alg Ar hash-algorithm
|
||||
|
|
|
|||
11
crypto/external/bsd/netpgp/lib/verify/Makefile
vendored
11
crypto/external/bsd/netpgp/lib/verify/Makefile
vendored
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.8 2015/04/15 19:13:46 mrg Exp $
|
||||
# $NetBSD: Makefile,v 1.9 2017/04/17 19:50:28 agc Exp $
|
||||
|
||||
LIB=netpgpverify
|
||||
SRCS+=b64.c
|
||||
|
|
@ -15,18 +15,9 @@ SRCS+=sha1.c
|
|||
SRCS+=sha2.c
|
||||
SRCS+=md5c.c
|
||||
SRCS+=rmd160.c
|
||||
SRCS+=tiger.c
|
||||
CPPFLAGS+=-I${.CURDIR} -I${EXTDIST}/src/netpgpverify
|
||||
MAN=libnetpgpverify.3
|
||||
WARNS=5
|
||||
#.if defined(__MINIX)
|
||||
#LSC: While Compiling with -O3:
|
||||
#<..>/lib/verify/../../dist/src/netpgpverify/bignum.c:802:5: error: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Werror=strict-overflow]
|
||||
# if (olduse > ix) {
|
||||
# ^
|
||||
# cc1: all warnings being treated as errors
|
||||
CWARNFLAGS+= -Wno-strict-overflow
|
||||
#.endif # defined(__MINIX)
|
||||
|
||||
EXTDIST=${.CURDIR}/../../dist
|
||||
.PATH: ${EXTDIST}/src/netpgpverify
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
major=4
|
||||
major=5
|
||||
minor=0
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user