diff options
author | 1999-12-06 19:04:57 +0000 | |
---|---|---|
committer | 1999-12-06 19:04:57 +0000 | |
commit | fa4decb3529ba637c84979b0c4634ad8522b623f (patch) | |
tree | 63a7fcef9c0622415ed916a6083cebaf7d0b9fff | |
parent | use openpty() if it exists (it does on BSD4_4) (diff) | |
download | wireguard-openbsd-fa4decb3529ba637c84979b0c4634ad8522b623f.tar.xz wireguard-openbsd-fa4decb3529ba637c84979b0c4634ad8522b623f.zip |
fd leak
-rw-r--r-- | lib/libskey/skeylogin.c | 5 | ||||
-rw-r--r-- | usr.bin/ssh/auth-skey.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c index dfb6ea5f2c5..57c85e932d5 100644 --- a/lib/libskey/skeylogin.c +++ b/lib/libskey/skeylogin.c @@ -12,7 +12,7 @@ * * S/KEY verification check, lookups, and authentication. * - * $OpenBSD: skeylogin.c,v 1.33 1999/11/26 19:26:17 deraadt Exp $ + * $OpenBSD: skeylogin.c,v 1.34 1999/12/06 19:04:58 deraadt Exp $ */ #include <sys/param.h> @@ -498,6 +498,7 @@ skey_authenticate(username) SEEK_SET) != -1 && read(fd, hseed, SKEY_MAX_SEED_LEN) == SKEY_MAX_SEED_LEN) { close(fd); + fd = -1; secret = hseed; secretlen = SKEY_MAX_SEED_LEN; flg = 0; @@ -507,6 +508,8 @@ skey_authenticate(username) secretlen = strlen(secret); flg = 0; } + if (fd != -1) + close(fd); } /* Put that in your pipe and smoke it */ diff --git a/usr.bin/ssh/auth-skey.c b/usr.bin/ssh/auth-skey.c index 9a1cc35a189..3610a67eff2 100644 --- a/usr.bin/ssh/auth-skey.c +++ b/usr.bin/ssh/auth-skey.c @@ -1,5 +1,5 @@ #include "includes.h" -RCSID("$Id: auth-skey.c,v 1.4 1999/12/01 16:54:35 markus Exp $"); +RCSID("$Id: auth-skey.c,v 1.5 1999/12/06 19:04:57 deraadt Exp $"); #include "ssh.h" #include "packet.h" @@ -104,6 +104,7 @@ skey_fake_keyinfo(char *username) SEEK_SET) != -1 && read(fd, hseed, SKEY_MAX_SEED_LEN) == SKEY_MAX_SEED_LEN) { close(fd); + fd = -1; secret = hseed; secretlen = SKEY_MAX_SEED_LEN; flg = 0; @@ -113,6 +114,8 @@ skey_fake_keyinfo(char *username) secretlen = strlen(secret); flg = 0; } + if (fd != -1) + close(fd); } /* Put that in your pipe and smoke it */ |