1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-28 21:50:02 +02:00
gnupg/checks/genkey1024.test

106 lines
2.7 KiB
Plaintext
Raw Normal View History

1998-02-26 17:56:31 +01:00
#!/bin/sh
2000-11-14 17:04:16 +01:00
echo "test is currently disabled"
exit 0
1998-09-14 12:33:57 +02:00
. $srcdir/defs.inc || exit 3
2000-11-14 17:04:16 +01:00
ignore_errors=yes
1998-02-26 17:56:31 +01:00
1998-09-28 21:25:31 +02:00
if (expect -v) < /dev/null > /dev/null 2>&1 ; then
1998-09-28 21:25:31 +02:00
:
else
echo "\"expect\" needed but not found - test skipped"
exit 0
fi
1998-11-10 13:59:59 +01:00
LANG=
LANGUAGE=
1998-09-28 21:25:31 +02:00
expect - <<EOF >/dev/null
1998-08-11 19:29:34 +02:00
#set timeout -1
1998-09-28 21:25:31 +02:00
set timeout 8
1998-02-26 17:56:31 +01:00
match_max 100000
spawn ../g10/gpg --no-batch --homedir . --gen-key
expect {
1998-08-11 19:29:34 +02:00
-exact "Please select what kind of key you want:\r
(1) DSA and ElGamal (default)\r
(2) DSA (sign only)\r
(4) ElGamal (sign and encrypt)\r
1998-08-11 19:29:34 +02:00
Your selection? " { send -- "1\r" }
timeout { exit 1 } }
expect {
-exact "1\r
1998-09-14 15:02:45 +02:00
\r \rDSA keypair will have 1024 bits.\r
1998-08-11 19:29:34 +02:00
About to generate a new ELG-E keypair.\r
1998-09-14 15:02:45 +02:00
minimum keysize is 768 bits\r
default keysize is 1024 bits\r
1998-02-26 17:56:31 +01:00
highest suggested keysize is 2048 bits\r
1998-08-11 19:29:34 +02:00
What keysize do you want? (1024) " { send -- "\r" }
timeout { exit 1 } }
expect {
-exact "\r
1998-09-14 15:02:45 +02:00
\r \rRequested keysize is 1024 bits\r
1998-08-11 19:29:34 +02:00
Please specify how long the key should be valid.\r
1998-09-14 15:02:45 +02:00
0 = key does not expire\r
1998-08-11 19:29:34 +02:00
<n> = key expires in n days\r
<n>w = key expires in n weeks\r
<n>m = key expires in n months\r
<n>y = key expires in n years\r
Key is valid for? (0) " { send -- "1\r" }
timeout { exit 1 } }
expect {
-exact "1\r
1998-09-14 15:02:45 +02:00
\r \rKey expires at " { }
1998-08-11 19:29:34 +02:00
timeout { exit 1 } }
expect {
1998-08-11 19:29:34 +02:00
-re "(.*)\r
" {}
timeout { exit 1 } }
expect {
-exact "Is this correct (y/n)? " { send -- "y\r" }
timeout { exit 1 } }
expect {
-exact "y\r
1998-09-14 15:02:45 +02:00
\r \r\r
1998-02-26 17:56:31 +01:00
You need a User-ID to identify your key; the software constructs the user id\r
from Real Name, Comment and Email Address in this form:\r
1998-08-11 19:29:34 +02:00
\"Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>\"\r
1998-02-26 17:56:31 +01:00
\r
1998-08-11 19:29:34 +02:00
Real name: " { send -- "Harry H.\r" }
timeout { exit 1 } }
expect {
-exact "Harry H.\r
1998-09-14 15:02:45 +02:00
\r \rEmail address: " { send -- "hh@ddorf.de\r" }
1998-08-11 19:29:34 +02:00
timeout { exit 1 } }
expect {
-exact "hh@ddorf.de\r
1998-09-14 15:02:45 +02:00
\r \rComment: " { send -- "a test\r" }
1998-08-11 19:29:34 +02:00
timeout { exit 1 } }
expect {
-exact "a test\r
1998-09-14 15:02:45 +02:00
\r \rYou selected this USER-ID:\r
\"Harry H. (a test) <hh@ddorf.de>\"\r
1998-02-26 17:56:31 +01:00
\r
1998-08-11 19:29:34 +02:00
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? " { send -- "o\r" }
timeout { exit 1 } }
expect {
-exact "o\r
1998-09-14 15:02:45 +02:00
\r \rYou need a Passphrase to protect your secret key.\r
1998-02-26 17:56:31 +01:00
\r
1998-11-10 13:59:59 +01:00
Enter passphrase: " { sleep 1; send -- "abc\r" }
1998-08-11 19:29:34 +02:00
timeout { exit 1 } }
expect {
1998-11-10 13:59:59 +01:00
-ex "\r \rRepeat passphrase: " { sleep 1; send -- "abc\r" }
1998-08-11 19:29:34 +02:00
timeout { exit 1 } }
set timeout 600
expect {
-re "^.*\r\npublic and secret key" { exit 0 }
1998-08-11 19:29:34 +02:00
eof { exit 1 }
1998-02-26 17:56:31 +01:00
}
1998-08-11 19:29:34 +02:00
exit 1
1998-02-26 17:56:31 +01:00
EOF
#*-*wedit:notab*-*