- jakob@cvs.openbsd.org 2003/11/03 09:37:32
[sshconnect.c]
do not free static type pointer in warn_changed_key()
+ - djm@cvs.openbsd.org 2003/11/04 08:54:09
+ [auth1.c auth2.c auth2-pubkey.c auth.h auth-krb5.c auth-passwd.c]
+ [auth-rhosts.c auth-rh-rsa.c auth-rsa.c monitor.c serverloop.c]
+ [session.c]
+ standardise arguments to auth methods - they should all take authctxt.
+ check authctxt->valid rather then pw != NULL; ok markus@
20031115
- (dtucker) [regress/agent-ptrace.sh] Test for GDB output from Solaris and
*/
#include "includes.h"
-RCSID("$OpenBSD: auth-krb5.c,v 1.13 2003/09/23 20:17:11 markus Exp $");
+RCSID("$OpenBSD: auth-krb5.c,v 1.14 2003/11/04 08:54:09 djm Exp $");
#include "ssh.h"
#include "ssh1.h"
krb5_error_code problem;
krb5_ccache ccache = NULL;
- if (authctxt->pw == NULL)
+ if (!authctxt->valid)
return (0);
temporarily_use_uid(authctxt->pw);
*/
#include "includes.h"
-RCSID("$OpenBSD: auth-passwd.c,v 1.29 2003/08/26 09:58:43 markus Exp $");
+RCSID("$OpenBSD: auth-passwd.c,v 1.30 2003/11/04 08:54:09 djm Exp $");
#include "packet.h"
#include "log.h"
struct passwd * pw = authctxt->pw;
int ok = authctxt->valid;
- /* deny if no user. */
- if (pw == NULL)
- return 0;
#ifndef HAVE_CYGWIN
- if (pw && pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
+ if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
ok = 0;
#endif
if (*password == '\0' && options.permit_empty_passwd == 0)
*/
#include "includes.h"
-RCSID("$OpenBSD: auth-rh-rsa.c,v 1.36 2003/06/02 09:17:34 markus Exp $");
+RCSID("$OpenBSD: auth-rh-rsa.c,v 1.37 2003/11/04 08:54:09 djm Exp $");
#include "packet.h"
#include "uidswap.h"
* its host key. Returns true if authentication succeeds.
*/
int
-auth_rhosts_rsa(struct passwd *pw, char *cuser, Key *client_host_key)
+auth_rhosts_rsa(Authctxt *authctxt, char *cuser, Key *client_host_key)
{
char *chost;
+ struct passwd *pw = authctxt->pw;
debug("Trying rhosts with RSA host authentication for client user %.100s",
cuser);
- if (pw == NULL || client_host_key == NULL ||
+ if (!authctxt->valid || client_host_key == NULL ||
client_host_key->rsa == NULL)
return 0;
*/
#include "includes.h"
-RCSID("$OpenBSD: auth-rhosts.c,v 1.31 2003/06/02 09:17:34 markus Exp $");
+RCSID("$OpenBSD: auth-rhosts.c,v 1.32 2003/11/04 08:54:09 djm Exp $");
#include "packet.h"
#include "uidswap.h"
debug2("auth_rhosts2: clientuser %s hostname %s ipaddr %s",
client_user, hostname, ipaddr);
- /* no user given */
- if (pw == NULL)
- return 0;
-
/* Switch to the user's uid. */
temporarily_use_uid(pw);
/*
*/
#include "includes.h"
-RCSID("$OpenBSD: auth-rsa.c,v 1.57 2003/04/08 20:21:28 itojun Exp $");
+RCSID("$OpenBSD: auth-rsa.c,v 1.58 2003/11/04 08:54:09 djm Exp $");
#include <openssl/rsa.h>
#include <openssl/md5.h>
* successful. This may exit if there is a serious protocol violation.
*/
int
-auth_rsa(struct passwd *pw, BIGNUM *client_n)
+auth_rsa(Authctxt *authctxt, BIGNUM *client_n)
{
Key *key;
char *fp;
+ struct passwd *pw = authctxt->pw;
/* no user given */
- if (pw == NULL)
+ if (!authctxt->valid)
return 0;
if (!PRIVSEP(auth_rsa_key_allowed(pw, client_n, &key))) {
-/* $OpenBSD: auth.h,v 1.47 2003/09/23 20:17:11 markus Exp $ */
+/* $OpenBSD: auth.h,v 1.48 2003/11/04 08:54:09 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
int
auth_rhosts2(struct passwd *, const char *, const char *, const char *);
-int auth_rhosts_rsa(struct passwd *, char *, Key *);
+int auth_rhosts_rsa(Authctxt *, char *, Key *);
int auth_password(Authctxt *, const char *);
-int auth_rsa(struct passwd *, BIGNUM *);
+int auth_rsa(Authctxt *, BIGNUM *);
int auth_rsa_challenge_dialog(Key *);
BIGNUM *auth_rsa_generate_challenge(Key *);
int auth_rsa_verify_response(Key *, BIGNUM *, u_char[]);
*/
#include "includes.h"
-RCSID("$OpenBSD: auth1.c,v 1.53 2003/09/23 20:17:11 markus Exp $");
+RCSID("$OpenBSD: auth1.c,v 1.54 2003/11/04 08:54:09 djm Exp $");
#include "xmalloc.h"
#include "rsa.h"
BN_num_bits(client_host_key->rsa->n), bits);
packet_check_eom();
- authenticated = auth_rhosts_rsa(pw, client_user,
+ authenticated = auth_rhosts_rsa(authctxt, client_user,
client_host_key);
key_free(client_host_key);
fatal("do_authloop: BN_new failed");
packet_get_bignum(n);
packet_check_eom();
- authenticated = auth_rsa(pw, n);
+ authenticated = auth_rsa(authctxt, n);
BN_clear_free(n);
break;
*/
#include "includes.h"
-RCSID("$OpenBSD: auth2-pubkey.c,v 1.4 2003/06/24 08:23:46 markus Exp $");
+RCSID("$OpenBSD: auth2-pubkey.c,v 1.5 2003/11/04 08:54:09 djm Exp $");
#include "ssh2.h"
#include "xmalloc.h"
Key *found;
char *fp;
- if (pw == NULL)
- return 0;
-
/* Temporarily use the user's uid. */
temporarily_use_uid(pw);
*/
#include "includes.h"
-RCSID("$OpenBSD: auth2.c,v 1.103 2003/09/23 20:17:11 markus Exp $");
+RCSID("$OpenBSD: auth2.c,v 1.104 2003/11/04 08:54:09 djm Exp $");
#include "ssh2.h"
#include "xmalloc.h"
static Authmethod *authmethod_lookup(const char *);
static char *authmethods_get(void);
int user_key_allowed(struct passwd *, Key *);
-int hostbased_key_allowed(struct passwd *, const char *, char *, Key *);
/*
* loop until authctxt->success == TRUE
*/
#include "includes.h"
-RCSID("$OpenBSD: monitor.c,v 1.50 2003/09/23 20:17:11 markus Exp $");
+RCSID("$OpenBSD: monitor.c,v 1.51 2003/11/04 08:54:09 djm Exp $");
#include <openssl/dh.h>
debug3("%s: key_from_blob: %p", __func__, key);
- if (key != NULL && authctxt->pw != NULL) {
+ if (key != NULL && authctxt->valid) {
switch(type) {
case MM_USERKEY:
allowed = options.pubkey_authentication &&
*/
#include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.111 2003/09/23 20:17:11 markus Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.112 2003/11/04 08:54:09 djm Exp $");
#include "xmalloc.h"
#include "packet.h"
u_short listen_port;
pw = the_authctxt->pw;
- if (pw == NULL)
- fatal("server_input_global_request: no user");
+ if (pw == NULL || !the_authctxt->pw)
+ fatal("server_input_global_request: no/invalid user");
listen_address = packet_get_string(NULL);
listen_port = (u_short)packet_get_int();
debug("server_input_global_request: tcpip-forward listen %s port %d",
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.166 2003/10/14 19:54:39 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.167 2003/11/04 08:54:09 djm Exp $");
#include "ssh.h"
#include "ssh1.h"
}
s->authctxt = authctxt;
s->pw = authctxt->pw;
- if (s->pw == NULL)
+ if (s->pw == NULL || !authctxt->valid)
fatal("no user for session %d", s->self);
debug("session_open: session %d: link with channel %d", s->self, chanid);
s->chanid = chanid;