summaryrefslogtreecommitdiff
path: root/ssh-keygen.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-08-23 10:46:23 +1000
committerDamien Miller <djm@mindrot.org>2000-08-23 10:46:23 +1000
commitad833b3e65c1887674714d514eb818d862bb499a (patch)
tree16fa75fe42aede072c5d3edac562c2870d1bb0e5 /ssh-keygen.c
parentb078567bf5de1dcf12d265d98acb4dc9eba8b325 (diff)
- (djm) Pick up LOGIN_PROGRAM from environment or PATH if not set by headers
- (djm) OpenBSD CVS updates: - deraadt@cvs.openbsd.org 2000/08/18 20:07:23 [ssh.c] accept remsh as a valid name as well; roman@buildpoint.com - deraadt@cvs.openbsd.org 2000/08/18 20:17:13 [deattack.c crc32.c packet.c] rename crc32() to ssh_crc32() to avoid zlib name clash. do not move to libz crc32 function yet, because it has ugly "long"'s in it; oneill@cs.sfu.ca - deraadt@cvs.openbsd.org 2000/08/18 20:26:08 [scp.1 scp.c] -S prog support; tv@debian.org - deraadt@cvs.openbsd.org 2000/08/18 20:50:07 [scp.c] knf - deraadt@cvs.openbsd.org 2000/08/18 20:57:33 [log-client.c] shorten - markus@cvs.openbsd.org 2000/08/19 12:48:11 [channels.c channels.h clientloop.c ssh.c ssh.h] support for ~. in ssh2 - deraadt@cvs.openbsd.org 2000/08/19 15:29:40 [crc32.h] proper prototype - markus@cvs.openbsd.org 2000/08/19 15:34:44 [authfd.c authfd.h key.c key.h ssh-add.1 ssh-add.c ssh-agent.1] [ssh-agent.c ssh-keygen.c sshconnect1.c sshconnect2.c Makefile] [fingerprint.c fingerprint.h] add SSH2/DSA support to the agent and some other DSA related cleanups. (note that we cannot talk to ssh.com's ssh2 agents) - markus@cvs.openbsd.org 2000/08/19 15:55:52 [channels.c channels.h clientloop.c] more ~ support for ssh2 - markus@cvs.openbsd.org 2000/08/19 16:21:19 [clientloop.c] oops - millert@cvs.openbsd.org 2000/08/20 12:25:53 [session.c] We have to stash the result of get_remote_name_or_ip() before we close our socket or getpeername() will get EBADF and the process will exit. Only a problem for "UseLogin yes". - millert@cvs.openbsd.org 2000/08/20 12:30:59 [session.c] Only check /etc/nologin if "UseLogin no" since login(1) may have its own policy on determining who is allowed to login when /etc/nologin is present. Also use the _PATH_NOLOGIN define. - millert@cvs.openbsd.org 2000/08/20 12:42:43 [auth1.c auth2.c session.c ssh.c] Add calls to setusercontext() and login_get*(). We basically call setusercontext() in most places where previously we did a setlogin(). Add default login.conf file and put root in the "daemon" login class. - millert@cvs.openbsd.org 2000/08/21 10:23:31 [session.c] Fix incorrect PATH setting; noted by Markus.
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 8a03f0d8d..83450fe84 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#include "includes.h" 9#include "includes.h"
10RCSID("$OpenBSD: ssh-keygen.c,v 1.29 2000/07/15 04:01:37 djm Exp $"); 10RCSID("$OpenBSD: ssh-keygen.c,v 1.30 2000/08/19 21:34:43 markus Exp $");
11 11
12#include <openssl/evp.h> 12#include <openssl/evp.h>
13#include <openssl/pem.h> 13#include <openssl/pem.h>
@@ -16,7 +16,6 @@ RCSID("$OpenBSD: ssh-keygen.c,v 1.29 2000/07/15 04:01:37 djm Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
19#include "fingerprint.h"
20#include "key.h" 19#include "key.h"
21#include "rsa.h" 20#include "rsa.h"
22#include "dsa.h" 21#include "dsa.h"
@@ -228,8 +227,9 @@ do_print_public(struct passwd *pw)
228void 227void
229do_fingerprint(struct passwd *pw) 228do_fingerprint(struct passwd *pw)
230{ 229{
230 /* XXX RSA1 only */
231
231 FILE *f; 232 FILE *f;
232 BIGNUM *e, *n;
233 Key *public; 233 Key *public;
234 char *comment = NULL, *cp, *ep, line[16*1024]; 234 char *comment = NULL, *cp, *ep, line[16*1024];
235 int i, skip = 0, num = 1, invalid = 1; 235 int i, skip = 0, num = 1, invalid = 1;
@@ -249,13 +249,9 @@ do_fingerprint(struct passwd *pw)
249 key_free(public); 249 key_free(public);
250 exit(0); 250 exit(0);
251 } 251 }
252 key_free(public);
253 252
254 /* XXX */
255 f = fopen(identity_file, "r"); 253 f = fopen(identity_file, "r");
256 if (f != NULL) { 254 if (f != NULL) {
257 n = BN_new();
258 e = BN_new();
259 while (fgets(line, sizeof(line), f)) { 255 while (fgets(line, sizeof(line), f)) {
260 i = strlen(line) - 1; 256 i = strlen(line) - 1;
261 if (line[i] != '\n') { 257 if (line[i] != '\n') {
@@ -290,18 +286,17 @@ do_fingerprint(struct passwd *pw)
290 *cp++ = '\0'; 286 *cp++ = '\0';
291 } 287 }
292 ep = cp; 288 ep = cp;
293 if (auth_rsa_read_key(&cp, &ignore, e, n)) { 289 if (auth_rsa_read_key(&cp, &ignore, public->rsa->e, public->rsa->n)) {
294 invalid = 0; 290 invalid = 0;
295 comment = *cp ? cp : comment; 291 comment = *cp ? cp : comment;
296 printf("%d %s %s\n", BN_num_bits(n), 292 printf("%d %s %s\n", key_size(public),
297 fingerprint(e, n), 293 key_fingerprint(public),
298 comment ? comment : "no comment"); 294 comment ? comment : "no comment");
299 } 295 }
300 } 296 }
301 BN_free(e);
302 BN_free(n);
303 fclose(f); 297 fclose(f);
304 } 298 }
299 key_free(public);
305 if (invalid) { 300 if (invalid) {
306 printf("%s is not a valid key file.\n", identity_file); 301 printf("%s is not a valid key file.\n", identity_file);
307 exit(1); 302 exit(1);