Changeset View
Changeset View
Standalone View
Standalone View
auth2-passwd.c
/* $OpenBSD: auth2-passwd.c,v 1.16 2018/07/09 21:35:50 markus Exp $ */ | /* $OpenBSD: auth2-passwd.c,v 1.18 2020/02/26 13:40:09 jsg Exp $ */ | ||||
/* | /* | ||||
* Copyright (c) 2000 Markus Friedl. All rights reserved. | * Copyright (c) 2000 Markus Friedl. All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
* notice, this list of conditions and the following disclaimer. | * notice, this list of conditions and the following disclaimer. | ||||
Show All 12 Lines | |||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
*/ | */ | ||||
#include "includes.h" | #include "includes.h" | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <stdlib.h> | |||||
#include <string.h> | #include <string.h> | ||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include <stdio.h> | |||||
#include "packet.h" | #include "packet.h" | ||||
#include "ssherr.h" | #include "ssherr.h" | ||||
#include "log.h" | #include "log.h" | ||||
#include "sshkey.h" | #include "sshkey.h" | ||||
#include "hostfile.h" | #include "hostfile.h" | ||||
#include "auth.h" | #include "auth.h" | ||||
#ifdef GSSAPI | #ifdef GSSAPI | ||||
Show All 19 Lines | if ((r = sshpkt_get_u8(ssh, &change)) != 0 || | ||||
(change && (r = sshpkt_get_cstring(ssh, NULL, NULL)) != 0) || | (change && (r = sshpkt_get_cstring(ssh, NULL, NULL)) != 0) || | ||||
(r = sshpkt_get_end(ssh)) != 0) | (r = sshpkt_get_end(ssh)) != 0) | ||||
fatal("%s: %s", __func__, ssh_err(r)); | fatal("%s: %s", __func__, ssh_err(r)); | ||||
if (change) | if (change) | ||||
logit("password change not supported"); | logit("password change not supported"); | ||||
else if (PRIVSEP(auth_password(ssh, password)) == 1) | else if (PRIVSEP(auth_password(ssh, password)) == 1) | ||||
authenticated = 1; | authenticated = 1; | ||||
explicit_bzero(password, len); | freezero(password, len); | ||||
free(password); | |||||
return authenticated; | return authenticated; | ||||
} | } | ||||
Authmethod method_passwd = { | Authmethod method_passwd = { | ||||
"password", | "password", | ||||
userauth_passwd, | userauth_passwd, | ||||
&options.password_authentication | &options.password_authentication | ||||
}; | }; |