From: deraadt Date: Wed, 26 Apr 2000 21:55:04 +0000 (+0000) Subject: add -R flag: exit code indicates if RSA is alive X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8d6aaf19f6b414f4d2420b7cfaaf8676dfe8d7af;p=openbsd add -R flag: exit code indicates if RSA is alive --- 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 #include @@ -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;