mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
* Makefile.am (bin_SCRIPTS): Add gpgsm-gencert.sh
* gpgsm-gencert.sh: Fixed copyright; its part of GnuPG thus FSF.
This commit is contained in:
parent
d230475aaf
commit
77a15fc9f8
@ -1,3 +1,9 @@
|
|||||||
|
2004-10-22 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* Makefile.am (bin_SCRIPTS): Add gpgsm-gencert.sh
|
||||||
|
|
||||||
|
* gpgsm-gencert.sh: Fixed copyright; its part of GnuPG thus FSF.
|
||||||
|
|
||||||
2004-10-01 Werner Koch <wk@g10code.com>
|
2004-10-01 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* gpgconf-comp.c: Made all strings for --log-file read the same.
|
* gpgconf-comp.c: Made all strings for --log-file read the same.
|
||||||
|
@ -30,6 +30,8 @@ AM_CFLAGS = @GPG_ERROR_CFLAGS@
|
|||||||
|
|
||||||
sbin_SCRIPTS = addgnupghome
|
sbin_SCRIPTS = addgnupghome
|
||||||
|
|
||||||
|
bin_SCRIPTS = gpgsm-gencert.sh
|
||||||
|
|
||||||
bin_PROGRAMS = gpgconf watchgnupg
|
bin_PROGRAMS = gpgconf watchgnupg
|
||||||
|
|
||||||
gpgconf_SOURCES = gpgconf.c gpgconf.h gpgconf-comp.c no-libgcrypt.c
|
gpgconf_SOURCES = gpgconf.c gpgconf.h gpgconf-comp.c no-libgcrypt.c
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# -*- sh -*-
|
||||||
# gpgsm-gencert.c - Generate X.509 certificates through GPGSM.
|
# gpgsm-gencert.c - Generate X.509 certificates through GPGSM.
|
||||||
# Copyright (C) 2004 g10 Code GmbH
|
# Copyright (C) 2004 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is part of GnuPG.
|
# This file is part of GnuPG.
|
||||||
#
|
#
|
||||||
@ -37,8 +37,8 @@ query_user()
|
|||||||
{
|
{
|
||||||
message=$1; shift
|
message=$1; shift
|
||||||
|
|
||||||
echo "$message"
|
echo "$message" >&2
|
||||||
echo -n "> "
|
echo -n "> " >&2
|
||||||
read answer
|
read answer
|
||||||
|
|
||||||
ANSWER=$answer;
|
ANSWER=$answer;
|
||||||
@ -49,15 +49,15 @@ query_user_menu()
|
|||||||
message=$1; shift
|
message=$1; shift
|
||||||
i=0
|
i=0
|
||||||
|
|
||||||
echo "$message"
|
echo "$message" >&2
|
||||||
for choice in "$@"; do
|
for choice in "$@"; do
|
||||||
i=$(expr $i + 1)
|
i=$(expr $i + 1)
|
||||||
echo " [$i] $choice"
|
echo " [$i] $choice" >&2
|
||||||
done
|
done
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
j=1
|
j=1
|
||||||
echo -n "Your selection: "
|
echo -n "Your selection: " >&2
|
||||||
read idx
|
read idx
|
||||||
|
|
||||||
while [ $j -lt $i -o $j -eq $i ]; do
|
while [ $j -lt $i -o $j -eq $i ]; do
|
||||||
@ -81,7 +81,7 @@ query_user_menu()
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "You selected: $ANSWER"
|
echo "You selected: $ANSWER" >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
query_user_menu "Key type" "RSA"
|
query_user_menu "Key type" "RSA"
|
||||||
@ -90,7 +90,7 @@ KEY_TYPE=$ANSWER
|
|||||||
query_user_menu "Key length" "1024" "2048"
|
query_user_menu "Key length" "1024" "2048"
|
||||||
KEY_LENGTH=$ANSWER
|
KEY_LENGTH=$ANSWER
|
||||||
|
|
||||||
query_user_menu "Key usage" "sign, encrypt"
|
query_user_menu "Key usage" "sign, encrypt" "sign" "encrypt"
|
||||||
KEY_USAGE=$ANSWER
|
KEY_USAGE=$ANSWER
|
||||||
|
|
||||||
query_user "Name"
|
query_user "Name"
|
||||||
@ -100,6 +100,7 @@ query_user "E-Mail address"
|
|||||||
EMAIL_ADDRESS=$ANSWER
|
EMAIL_ADDRESS=$ANSWER
|
||||||
|
|
||||||
file_parameter=$(mktemp "/tmp/gpgsm.XXXXXX")
|
file_parameter=$(mktemp "/tmp/gpgsm.XXXXXX")
|
||||||
|
outfile=$(mktemp "/tmp/gpgsm.XXXXXX")
|
||||||
|
|
||||||
cat > "$file_parameter" <<EOF
|
cat > "$file_parameter" <<EOF
|
||||||
Key-Type: $KEY_TYPE
|
Key-Type: $KEY_TYPE
|
||||||
@ -109,7 +110,10 @@ Name-DN: $NAME
|
|||||||
Name-Email: $EMAIL_ADDRESS
|
Name-Email: $EMAIL_ADDRESS
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo -e "$ASSUAN_COMMANDS" | gpgsm --server 4< "$file_parameter" 5>&1
|
echo -e "$ASSUAN_COMMANDS" | \
|
||||||
|
gpgsm --server 4< "$file_parameter" 5>"$outfile" >/dev/null
|
||||||
|
|
||||||
rm "$file_parameter"
|
cat "$outfile"
|
||||||
|
|
||||||
|
rm "$file_parameter" "$outfile"
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user