]> andersk Git - openssh.git/blobdiff - ssh-agent.c
- Merged yet more changes from OpenBSD CVS
[openssh.git] / ssh-agent.c
index a9d2a1426b27c5b388336f216099b86d0f4f3f1e..7f4543e92eb5c0480a60ccff0899588ad67d77be 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ssh-agent.c,v 1.15 1999/10/28 08:43:10 markus Exp $   */
+/*     $OpenBSD: ssh-agent.c,v 1.16 1999/10/28 20:41:23 markus Exp $   */
 
 /*
 
@@ -15,9 +15,8 @@ The authentication agent program.
 
 */
 
-#include "config.h"
 #include "includes.h"
-RCSID("$OpenBSD: ssh-agent.c,v 1.15 1999/10/28 08:43:10 markus Exp $");
+RCSID("$OpenBSD: ssh-agent.c,v 1.17 1999/11/02 19:42:36 markus Exp $");
 
 #include "ssh.h"
 #include "rsa.h"
@@ -137,7 +136,12 @@ process_authentication_challenge(SocketEntry *e)
          case 1: /* As of protocol 1.1 */
            /* The response is MD5 of decrypted challenge plus session id. */
            len = BN_num_bytes(challenge);
-           assert(len <= 32 && len);
+
+           if (len <= 0 || len > 32) {
+             fatal("process_authentication_challenge: "
+                   "bad challenge length %d", len);
+           }
+
            memset(buf, 0, 32);
            BN_bn2bin(challenge, buf + 32 - len);
            MD5_Init(&md);
@@ -527,7 +531,11 @@ main(int ac, char **av)
     exit(1);
   }
 
+#if defined(__GNU_LIBRARY__)
+  while ((ch = getopt(ac, av, "+cks")) != -1)
+#else 
   while ((ch = getopt(ac, av, "cks")) != -1)
+#endif /* defined(__GNU_LIBRARY__) */
     {
       switch (ch)
        {
@@ -656,11 +664,17 @@ main(int ac, char **av)
   close(1);
   close(2);
 
-  if (ac == 0 && setsid() == -1)
-    cleanup_exit(1);
+  if (setsid() == -1)
+    {
+      perror("setsid");
+      cleanup_exit(1);
+    }
 
   if (atexit(cleanup_socket) < 0)
-    cleanup_exit(1);
+    {
+      perror("atexit");
+      cleanup_exit(1);
+    }
 
   new_socket(AUTH_SOCKET, sock);
   if (ac > 0)
This page took 0.035013 seconds and 4 git commands to generate.