summaryrefslogtreecommitdiff
path: root/ssh-keysign.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2009-12-29 21:34:25 +0000
committerColin Watson <cjwatson@debian.org>2009-12-29 21:34:25 +0000
commitfa585019a79ebcb4e0202b1c33f87ff1c5c9ce1c (patch)
tree28fc9a13eaab935e4de055b561b333d67387a934 /ssh-keysign.c
parent04942aa41fa94ec6f2c3ce1d348f600f31bb7c78 (diff)
parent3e2e0ac10674d77618c4c7339e18b83ced247492 (diff)
import openssh-4.3p2-gsskex-20060223.patch
Diffstat (limited to 'ssh-keysign.c')
-rw-r--r--ssh-keysign.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ssh-keysign.c b/ssh-keysign.c
index 04597a91d..dae3a2e8c 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -22,7 +22,7 @@
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24#include "includes.h" 24#include "includes.h"
25RCSID("$OpenBSD: ssh-keysign.c,v 1.18 2004/08/23 14:29:23 dtucker Exp $"); 25RCSID("$OpenBSD: ssh-keysign.c,v 1.19 2005/09/13 23:40:07 djm Exp $");
26 26
27#include <openssl/evp.h> 27#include <openssl/evp.h>
28#include <openssl/rand.h> 28#include <openssl/rand.h>
@@ -148,6 +148,13 @@ main(int argc, char **argv)
148 u_int slen, dlen; 148 u_int slen, dlen;
149 u_int32_t rnd[256]; 149 u_int32_t rnd[256];
150 150
151 /* Ensure that stdin and stdout are connected */
152 if ((fd = open(_PATH_DEVNULL, O_RDWR)) < 2)
153 exit(1);
154 /* Leave /dev/null fd iff it is attached to stderr */
155 if (fd > 2)
156 close(fd);
157
151 key_fd[0] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY); 158 key_fd[0] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY);
152 key_fd[1] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY); 159 key_fd[1] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY);
153 160