Deleted Added
full compact
auth-krb5.c (126277) auth-krb5.c (128460)
1/*
2 * Kerberos v5 authentication and ticket-passing routines.
3 *
4 * $xFreeBSD: src/crypto/openssh/auth-krb5.c,v 1.6 2001/02/13 16:58:04 assar Exp$
5 */
6/*
7 * Copyright (c) 2002 Daniel Kouril. All rights reserved.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include "includes.h"
31RCSID("$OpenBSD: auth-krb5.c,v 1.15 2003/11/21 11:57:02 djm Exp $");
1/*
2 * Kerberos v5 authentication and ticket-passing routines.
3 *
4 * $xFreeBSD: src/crypto/openssh/auth-krb5.c,v 1.6 2001/02/13 16:58:04 assar Exp$
5 */
6/*
7 * Copyright (c) 2002 Daniel Kouril. All rights reserved.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include "includes.h"
31RCSID("$OpenBSD: auth-krb5.c,v 1.15 2003/11/21 11:57:02 djm Exp $");
32RCSID("$FreeBSD: head/crypto/openssh/auth-krb5.c 126277 2004-02-26 10:52:33Z des $");
32RCSID("$FreeBSD: head/crypto/openssh/auth-krb5.c 128460 2004-04-20 09:46:41Z des $");
33
34#include "ssh.h"
35#include "ssh1.h"
36#include "packet.h"
37#include "xmalloc.h"
38#include "log.h"
39#include "servconf.h"
40#include "uidswap.h"

--- 9 unchanged lines hidden (view full) ---

50{
51 Authctxt *authctxt = (Authctxt *)context;
52 krb5_error_code problem;
53
54 if (authctxt->krb5_ctx == NULL) {
55 problem = krb5_init_context(&authctxt->krb5_ctx);
56 if (problem)
57 return (problem);
33
34#include "ssh.h"
35#include "ssh1.h"
36#include "packet.h"
37#include "xmalloc.h"
38#include "log.h"
39#include "servconf.h"
40#include "uidswap.h"

--- 9 unchanged lines hidden (view full) ---

50{
51 Authctxt *authctxt = (Authctxt *)context;
52 krb5_error_code problem;
53
54 if (authctxt->krb5_ctx == NULL) {
55 problem = krb5_init_context(&authctxt->krb5_ctx);
56 if (problem)
57 return (problem);
58#ifdef KRB5_INIT_ETS
58 krb5_init_ets(authctxt->krb5_ctx);
59 krb5_init_ets(authctxt->krb5_ctx);
60#endif
59 }
60 return (0);
61}
62
63int
64auth_krb5_password(Authctxt *authctxt, const char *password)
65{
66#ifndef HEIMDAL
67 krb5_creds creds;
68 krb5_principal server;
69 char ccname[40];
70 int tmpfd;
71#endif
72 krb5_error_code problem;
73 krb5_ccache ccache = NULL;
61 }
62 return (0);
63}
64
65int
66auth_krb5_password(Authctxt *authctxt, const char *password)
67{
68#ifndef HEIMDAL
69 krb5_creds creds;
70 krb5_principal server;
71 char ccname[40];
72 int tmpfd;
73#endif
74 krb5_error_code problem;
75 krb5_ccache ccache = NULL;
76 int len;
74
75 if (!authctxt->valid)
76 return (0);
77
78 temporarily_use_uid(authctxt->pw);
79
80 problem = krb5_init(authctxt);
81 if (problem)

--- 89 unchanged lines hidden (view full) ---

171 problem= krb5_cc_store_cred(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache,
172 &creds);
173 if (problem)
174 goto out;
175#endif
176
177 authctxt->krb5_ticket_file = (char *)krb5_cc_get_name(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache);
178
77
78 if (!authctxt->valid)
79 return (0);
80
81 temporarily_use_uid(authctxt->pw);
82
83 problem = krb5_init(authctxt);
84 if (problem)

--- 89 unchanged lines hidden (view full) ---

174 problem= krb5_cc_store_cred(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache,
175 &creds);
176 if (problem)
177 goto out;
178#endif
179
180 authctxt->krb5_ticket_file = (char *)krb5_cc_get_name(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache);
181
182 len = strlen(authctxt->krb5_ticket_file) + 6;
183 authctxt->krb5_ccname = xmalloc(len);
184 snprintf(authctxt->krb5_ccname, len, "FILE:%s",
185 authctxt->krb5_ticket_file);
186
179 out:
180 restore_uid();
181
182 if (problem) {
183 if (ccache)
184 krb5_cc_destroy(authctxt->krb5_ctx, ccache);
185
186 if (authctxt->krb5_ctx != NULL && problem!=-1)

--- 35 unchanged lines hidden ---
187 out:
188 restore_uid();
189
190 if (problem) {
191 if (ccache)
192 krb5_cc_destroy(authctxt->krb5_ctx, ccache);
193
194 if (authctxt->krb5_ctx != NULL && problem!=-1)

--- 35 unchanged lines hidden ---