1 /*
2 * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
27 * ===========================================================================
28 * (C) Copyright IBM Corp. 2000 All Rights Reserved.
29 * ===========================================================================
30 */
31
32 #define UNICODE
33 #define _UNICODE
34
35 #include <windows.h>
36 #include <stdio.h>
37 #include <string.h>
38 #define SECURITY_WIN32
39 #include <security.h>
40 #include <ntsecapi.h>
41 #include <dsgetdc.h>
42 #include <lmcons.h>
43 #include <lmapibuf.h>
44 #include <jni.h>
45 #include "jni_util.h"
46 #include <winsock.h>
47
48 #undef LSA_SUCCESS
49 #define LSA_SUCCESS(Status) ((Status) >= 0)
50 #define EXIT_FAILURE -1 // mdu
51
52 /*
53 * Library-wide static references
54 */
55
56 jclass derValueClass = NULL;
57 jclass ticketClass = NULL;
58 jclass principalNameClass = NULL;
59 jclass encryptionKeyClass = NULL;
60 jclass ticketFlagsClass = NULL;
61 jclass kerberosTimeClass = NULL;
62 jclass javaLangStringClass = NULL;
63
64 jmethodID derValueConstructor = 0;
65 jmethodID ticketConstructor = 0;
66 jmethodID principalNameConstructor = 0;
|
1 /*
2 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
27 * ===========================================================================
28 * (C) Copyright IBM Corp. 2000 All Rights Reserved.
29 * ===========================================================================
30 */
31
32 #define UNICODE
33 #define _UNICODE
34
35 #include <windows.h>
36 #include <stdio.h>
37 #include <string.h>
38 #define SECURITY_WIN32
39 #include <security.h>
40 #include <ntsecapi.h>
41 #include <dsgetdc.h>
42 #include <lmcons.h>
43 #include <lmapibuf.h>
44 #include <jni.h>
45 #include "jni_util.h"
46 #include <winsock.h>
47 #include "sun_security_krb5_Credentials.h"
48
49 #undef LSA_SUCCESS
50 #define LSA_SUCCESS(Status) ((Status) >= 0)
51 #define EXIT_FAILURE -1 // mdu
52
53 /*
54 * Library-wide static references
55 */
56
57 jclass derValueClass = NULL;
58 jclass ticketClass = NULL;
59 jclass principalNameClass = NULL;
60 jclass encryptionKeyClass = NULL;
61 jclass ticketFlagsClass = NULL;
62 jclass kerberosTimeClass = NULL;
63 jclass javaLangStringClass = NULL;
64
65 jmethodID derValueConstructor = 0;
66 jmethodID ticketConstructor = 0;
67 jmethodID principalNameConstructor = 0;
|