]> andersk Git - openssh.git/blobdiff - auth-rsa.c
- markus@cvs.openbsd.org 2001/12/27 20:39:58
[openssh.git] / auth-rsa.c
index 5846a0662c9fc38132ef1bc839cccc8a732dce98..4403c149082026906f22bdb3863255b60c7a48f2 100644 (file)
@@ -14,7 +14,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth-rsa.c,v 1.46 2001/12/18 10:06:24 jakob Exp $");
+RCSID("$OpenBSD: auth-rsa.c,v 1.49 2001/12/28 12:14:27 markus Exp $");
 
 #include <openssl/rsa.h>
 #include <openssl/md5.h>
@@ -68,12 +68,15 @@ auth_rsa_challenge_dialog(RSA *pk)
        u_int i;
        int plen, len;
 
-       encrypted_challenge = BN_new();
-       challenge = BN_new();
+       if ((encrypted_challenge = BN_new()) == NULL)
+               fatal("auth_rsa_challenge_dialog: BN_new() failed");
+       if ((challenge = BN_new()) == NULL)
+               fatal("auth_rsa_challenge_dialog: BN_new() failed");
 
        /* Generate a random challenge. */
        BN_rand(challenge, 256, 0, 0);
-       ctx = BN_CTX_new();
+       if ((ctx = BN_CTX_new()) == NULL)
+               fatal("auth_rsa_challenge_dialog: BN_CTX_new() failed");
        BN_mod(challenge, challenge, pk->n, ctx);
        BN_CTX_free(ctx);
 
@@ -89,9 +92,9 @@ auth_rsa_challenge_dialog(RSA *pk)
 
        /* Wait for a response. */
        packet_read_expect(&plen, SSH_CMSG_AUTH_RSA_RESPONSE);
-       packet_integrity_check(plen, 16, SSH_CMSG_AUTH_RSA_RESPONSE);
        for (i = 0; i < 16; i++)
                response[i] = packet_get_char();
+       packet_check_eom();
 
        /* The response is MD5 of decrypted challenge plus session id. */
        len = BN_num_bytes(challenge);
This page took 0.091136 seconds and 4 git commands to generate.