-/* $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 $ */
/*
*/
-#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"
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);
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)
{
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)