X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/f3c7c61373d79f23a88ffa48a4937138128113c9..a8666d84f39ef07875841e8e0e75caf276d7b864:/ssh-agent.c diff --git a/ssh-agent.c b/ssh-agent.c index a558ecef..e8362ded 100644 --- a/ssh-agent.c +++ b/ssh-agent.c @@ -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 @@ -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 #include @@ -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) {