1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-31 22:18:03 +02:00
gnupg/checks/genkey1024.test

107 lines
3.1 KiB
Plaintext
Raw Normal View History

1998-02-26 17:56:31 +01:00
#!/bin/sh
1998-09-14 12:33:57 +02:00
. $srcdir/defs.inc || exit 3
1998-02-26 17:56:31 +01:00
1998-09-28 21:25:31 +02:00
if which expect ; then
:
else
echo "\"expect\" needed but not found - test skipped"
exit 0
fi
1998-02-26 17:56:31 +01:00
expect - <<EOF
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 --quick-random --homedir . --gen-key
1998-09-14 15:02:45 +02:00
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) ElGamal (sign and encrypt)\r
(3) ElGamal (encrypt only)\r
(4) DSA (sign only)\r
(5) ElGamal in a v3 packet\r
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 } }
1998-09-14 15:02:45 +02:00
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
1998-02-26 17:56:31 +01:00
\"Harry H. (a test) <hh@ddorf.de> (INSECURE!)\"\r
\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-08-11 19:29:34 +02:00
Enter pass phrase: " { sleep 1; send -- "abc\r" }
timeout { exit 1 } }
expect {
-ex "\r \rRepeat pass phrase: " { sleep 1; send -- "abc\r" }
timeout { exit 1 } }
1998-09-14 15:02:45 +02:00
expect {
1998-08-11 19:29:34 +02:00
-ex "\r \rWe need to generate a lot of random bytes. It is a good idea to perform\r
some other action (work in another window, move the mouse, utilize the\r
network and the disks) during the prime generation; this gives the random\r
number generator a better chance to gain enough entropy.\r" {}
timeout { exit 1 } }
1998-09-28 21:25:31 +02:00
set timeout 600
1998-08-11 19:29:34 +02:00
expect {
-ex "public and secret key created and signed.\r" { exit 0 }
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