summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sshconnect.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>1999-11-15 20:53:26 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>1999-11-15 20:53:26 +0000
commitcdf893c82de47c89e39f0b6f6b5bd22eccfc1664 (patch)
treec40a03851018c4d29f6538fb42d0e1333f2e201a /usr.bin/ssh/sshconnect.c
parenta19cc305d68e393ccdca98f94032cbf60cd8d364 (diff)
the keysize of rsa-parameter 'n' is passed implizit,
a few more checks and warnings about 'pretended' keysizes.
Diffstat (limited to 'usr.bin/ssh/sshconnect.c')
-rw-r--r--usr.bin/ssh/sshconnect.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index 83e8f4b899e..ee15bbfa6a3 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/sshconnect.c
@@ -15,7 +15,7 @@ login (authentication) dialog.
*/
#include "includes.h"
-RCSID("$Id: sshconnect.c,v 1.28 1999/11/15 00:42:01 markus Exp $");
+RCSID("$Id: sshconnect.c,v 1.29 1999/11/15 20:53:25 markus Exp $");
#include <ssl/bn.h>
#include "xmalloc.h"
@@ -333,7 +333,7 @@ int ssh_connect(const char *host, struct sockaddr_in *hostaddr,
int
try_agent_authentication()
{
- int status, type, bits;
+ int status, type;
char *comment;
AuthenticationConnection *auth;
unsigned char response[16];
@@ -350,9 +350,9 @@ try_agent_authentication()
challenge = BN_new();
/* Loop through identities served by the agent. */
- for (status = ssh_get_first_identity(auth, &bits, e, n, &comment);
+ for (status = ssh_get_first_identity(auth, e, n, &comment);
status;
- status = ssh_get_next_identity(auth, &bits, e, n, &comment))
+ status = ssh_get_next_identity(auth, e, n, &comment))
{
int plen, clen;
@@ -389,7 +389,7 @@ try_agent_authentication()
debug("Received RSA challenge from server.");
/* Ask the agent to decrypt the challenge. */
- if (!ssh_decrypt_challenge(auth, bits, e, n, challenge,
+ if (!ssh_decrypt_challenge(auth, e, n, challenge,
session_id, 1, response))
{
/* The agent failed to authenticate this identifier although it
@@ -1122,19 +1122,15 @@ void ssh_login(int host_key_valid,
SSH_SMSG_PUBLIC_KEY);
/* Compute the session id. */
- compute_session_id(session_id, check_bytes,
- BN_num_bits(host_key->n), host_key->n,
- BN_num_bits(public_key->n), public_key->n);
+ compute_session_id(session_id, check_bytes, host_key->n, public_key->n);
/* Check if the host key is present in the user\'s list of known hosts
or in the systemwide list. */
- host_status = check_host_in_hostfile(options.user_hostfile,
- host, BN_num_bits(host_key->n),
+ host_status = check_host_in_hostfile(options.user_hostfile, host,
host_key->e, host_key->n,
file_key->e, file_key->n);
if (host_status == HOST_NEW)
host_status = check_host_in_hostfile(options.system_hostfile, host,
- BN_num_bits(host_key->n),
host_key->e, host_key->n,
file_key->e, file_key->n);
/* Force accepting of the host key for localhost and 127.0.0.1.
@@ -1155,13 +1151,11 @@ void ssh_login(int host_key_valid,
ip_key->n = BN_new();
ip_key->e = BN_new();
ip_status = check_host_in_hostfile(options.user_hostfile, ip,
- BN_num_bits(host_key->n),
host_key->e, host_key->n,
ip_key->e, ip_key->n);
if (ip_status == HOST_NEW)
ip_status = check_host_in_hostfile(options.system_hostfile, ip,
- BN_num_bits(host_key->n),
host_key->e, host_key->n,
ip_key->e, ip_key->n);
if (host_status == HOST_CHANGED &&
@@ -1182,7 +1176,6 @@ void ssh_login(int host_key_valid,
if (options.check_host_ip) {
if (ip_status == HOST_NEW) {
if (!add_host_to_hostfile(options.user_hostfile, ip,
- BN_num_bits(host_key->n),
host_key->e, host_key->n))
log("Failed to add the host ip to the list of known hosts (%.30s).",
options.user_hostfile);
@@ -1220,7 +1213,6 @@ void ssh_login(int host_key_valid,
/* If not in strict mode, add the key automatically to the local
known_hosts file. */
if (!add_host_to_hostfile(options.user_hostfile, hostp,
- BN_num_bits(host_key->n),
host_key->e, host_key->n))
log("Failed to add the host to the list of known hosts (%.500s).",
options.user_hostfile);