summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-04-26 21:55:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-04-26 21:55:05 +0000
commit36dec3d4e4487e274b7fbc86b320a5b82e5f37b4 (patch)
treeed14f50f37dbf8f96c05782f9802fd3d51b478b4
parent2f0d5f00c413ab326bcc19c50b8742744e93a779 (diff)
add -R flag: exit code indicates if RSA is alive
-rw-r--r--usr.bin/ssh/ssh-keygen.18
-rw-r--r--usr.bin/ssh/ssh-keygen.c11
2 files changed, 16 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-keygen.1 b/usr.bin/ssh/ssh-keygen.1
index 68e27db444d..59c73cca741 100644
--- a/usr.bin/ssh/ssh-keygen.1
+++ b/usr.bin/ssh/ssh-keygen.1
@@ -9,7 +9,7 @@
.\"
.\" Created: Sat Apr 22 23:55:14 1995 ylo
.\"
-.\" $Id: ssh-keygen.1,v 1.13 2000/04/12 21:47:51 aaron Exp $
+.\" $Id: ssh-keygen.1,v 1.14 2000/04/26 21:55:04 deraadt Exp $
.\"
.Dd September 25, 1999
.Dt SSH-KEYGEN 1
@@ -37,6 +37,8 @@
.Nm ssh-keygen
.Fl l
.Op Fl f Ar keyfile
+.Nm ssh-keygen
+.Fl R
.Sh DESCRIPTION
.Nm
generates and manages authentication keys for
@@ -112,6 +114,10 @@ Provides the new comment.
Provides the new passphrase.
.It Fl P Ar passphrase
Provides the (old) passphrase.
+.It Fl R
+If RSA support is functional, immediately exits with code 0. If RSA
+support is not functional, exits with code 1. This flag will be
+removed once the RSA patent expires.
.El
.Sh FILES
.Bl -tag -width Ds
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index 5482839578d..eae66500250 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -7,7 +7,7 @@
*/
#include "includes.h"
-RCSID("$Id: ssh-keygen.c,v 1.19 2000/04/26 20:56:29 markus Exp $");
+RCSID("$Id: ssh-keygen.c,v 1.20 2000/04/26 21:55:04 deraadt Exp $");
#include <openssl/evp.h>
#include <openssl/pem.h>
@@ -519,7 +519,7 @@ main(int ac, char **av)
exit(1);
}
- while ((opt = getopt(ac, av, "dqpclxXyb:f:P:N:C:")) != EOF) {
+ while ((opt = getopt(ac, av, "dqpclRxXyb:f:P:N:C:")) != EOF) {
switch (opt) {
case 'b':
bits = atoi(optarg);
@@ -562,6 +562,13 @@ main(int ac, char **av)
quiet = 1;
break;
+ case 'R':
+ if (rsa_alive() == 0)
+ exit(1);
+ else
+ exit(0);
+ break;
+
case 'x':
convert_to_ssh2 = 1;
break;