]> andersk Git - openssh.git/blobdiff - ssh-agent.c
- markus@cvs.openbsd.org 2001/04/09 15:12:23
[openssh.git] / ssh-agent.c
index a558ecef7d6b9776176962aaf41a21af5ca044ec..e8362ded0ed0c364637bb004e826cfc8b474231b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ssh-agent.c,v 1.51 2001/03/02 18:54:31 deraadt Exp $  */
+/*     $OpenBSD: ssh-agent.c,v 1.54 2001/04/03 13:56:11 stevesk Exp $  */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -37,7 +37,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-agent.c,v 1.51 2001/03/02 18:54:31 deraadt Exp $");
+RCSID("$OpenBSD: ssh-agent.c,v 1.54 2001/04/03 13:56:11 stevesk Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/md5.h>
@@ -360,25 +360,6 @@ process_remove_all_identities(SocketEntry *e, int version)
        return;
 }
 
-void
-generate_additional_parameters(RSA *rsa)
-{
-       BIGNUM *aux;
-       BN_CTX *ctx;
-       /* Generate additional parameters */
-       aux = BN_new();
-       ctx = BN_CTX_new();
-
-       BN_sub(aux, rsa->q, BN_value_one());
-       BN_mod(rsa->dmq1, rsa->d, aux, ctx);
-
-       BN_sub(aux, rsa->p, BN_value_one());
-       BN_mod(rsa->dmp1, rsa->d, aux, ctx);
-
-       BN_clear_free(aux);
-       BN_CTX_free(ctx);
-}
-
 void
 process_add_identity(SocketEntry *e, int version)
 {
@@ -582,9 +563,9 @@ prepare_select(fd_set **fdrp, fd_set **fdwp, int *fdl)
        sz = howmany(n+1, NFDBITS) * sizeof(fd_mask);
        if (*fdrp == NULL || n > *fdl) {
                if (*fdrp)
-                       free(*fdrp);
+                       xfree(*fdrp);
                if (*fdwp)
-                       free(*fdwp);
+                       xfree(*fdwp);
                *fdrp = xmalloc(sz);
                *fdwp = xmalloc(sz);
                *fdl = n;
@@ -635,9 +616,15 @@ after_select(fd_set *readset, fd_set *writeset)
                case AUTH_CONNECTION:
                        if (buffer_len(&sockets[i].output) > 0 &&
                            FD_ISSET(sockets[i].fd, writeset)) {
-                               len = write(sockets[i].fd,
-                                   buffer_ptr(&sockets[i].output),
-                                   buffer_len(&sockets[i].output));
+                               do {
+                                       len = write(sockets[i].fd,
+                                           buffer_ptr(&sockets[i].output),
+                                           buffer_len(&sockets[i].output));
+                                       if (len == -1 && (errno == EAGAIN ||
+                                           errno == EINTR))
+                                               continue;
+                                       break;
+                               } while (1);
                                if (len <= 0) {
                                        shutdown(sockets[i].fd, SHUT_RDWR);
                                        close(sockets[i].fd);
@@ -649,7 +636,13 @@ after_select(fd_set *readset, fd_set *writeset)
                                buffer_consume(&sockets[i].output, len);
                        }
                        if (FD_ISSET(sockets[i].fd, readset)) {
-                               len = read(sockets[i].fd, buf, sizeof(buf));
+                               do {
+                                       len = read(sockets[i].fd, buf, sizeof(buf));
+                                       if (len == -1 && (errno == EAGAIN ||
+                                           errno == EINTR))
+                                               continue;
+                                       break;
+                               } while (1);
                                if (len <= 0) {
                                        shutdown(sockets[i].fd, SHUT_RDWR);
                                        close(sockets[i].fd);
@@ -726,8 +719,11 @@ main(int ac, char **av)
        extern int optind;
        fd_set *readsetp = NULL, *writesetp = NULL;
 
+       SSLeay_add_all_algorithms();
+
        __progname = get_progname(av[0]);
        init_rng();
+       seed_rng();
 
 #ifdef __GNU_LIBRARY__
        while ((ch = getopt(ac, av, "+cks")) != -1) {
This page took 0.055229 seconds and 4 git commands to generate.