/src/FreeRDP/winpr/libwinpr/sspi/sspi_gss.h
Line | Count | Source (jump to first uncovered line) |
1 | | /** |
2 | | * FreeRDP: A Remote Desktop Protocol Implementation |
3 | | * Generic Security Service Application Program Interface (GSSAPI) |
4 | | * |
5 | | * Copyright 2015 ANSSI, Author Thomas Calderon |
6 | | * Copyright 2015 Marc-Andre Moreau <marcandre.moreau@gmail.com> |
7 | | * Copyright 2017 Dorian Ducournau <dorian.ducournau@gmail.com> |
8 | | * |
9 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
10 | | * you may not use this file except in compliance with the License. |
11 | | * You may obtain a copy of the License at |
12 | | * |
13 | | * http://www.apache.org/licenses/LICENSE-2.0 |
14 | | * |
15 | | * Unless required by applicable law or agreed to in writing, software |
16 | | * distributed under the License is distributed on an "AS IS" BASIS, |
17 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
18 | | * See the License for the specific language governing permissions and |
19 | | * limitations under the License. |
20 | | */ |
21 | | |
22 | | #ifndef WINPR_SSPI_GSS_PRIVATE_H |
23 | | #define WINPR_SSPI_GSS_PRIVATE_H |
24 | | |
25 | | #include <winpr/sspi.h> |
26 | | #include <winpr/asn1.h> |
27 | | |
28 | | #ifdef WITH_KRB5_MIT |
29 | | #include <krb5.h> |
30 | | typedef krb5_data sspi_gss_data; |
31 | | #elif defined(WITH_KRB5_HEIMDAL) |
32 | | #include <krb5.h> |
33 | | typedef krb5_data sspi_gss_data; |
34 | | #else |
35 | | typedef struct |
36 | | { |
37 | | int32_t magic; |
38 | | unsigned int length; |
39 | | char* data; |
40 | | } sspi_gss_data; |
41 | | #endif |
42 | | |
43 | | #define SSPI_GSS_C_DELEG_FLAG 1 |
44 | 0 | #define SSPI_GSS_C_MUTUAL_FLAG 2 |
45 | | #define SSPI_GSS_C_REPLAY_FLAG 4 |
46 | 0 | #define SSPI_GSS_C_SEQUENCE_FLAG 8 |
47 | 0 | #define SSPI_GSS_C_CONF_FLAG 16 |
48 | 0 | #define SSPI_GSS_C_INTEG_FLAG 32 |
49 | | |
50 | 0 | #define FLAG_SENDER_IS_ACCEPTOR 0x01 |
51 | 0 | #define FLAG_WRAP_CONFIDENTIAL 0x02 |
52 | 0 | #define FLAG_ACCEPTOR_SUBKEY 0x04 |
53 | | |
54 | 0 | #define KG_USAGE_ACCEPTOR_SEAL 22 |
55 | 0 | #define KG_USAGE_ACCEPTOR_SIGN 23 |
56 | 0 | #define KG_USAGE_INITIATOR_SEAL 24 |
57 | 0 | #define KG_USAGE_INITIATOR_SIGN 25 |
58 | | |
59 | 0 | #define TOK_ID_AP_REQ 0x0100 |
60 | 0 | #define TOK_ID_AP_REP 0x0200 |
61 | 0 | #define TOK_ID_ERROR 0x0300 |
62 | 0 | #define TOK_ID_TGT_REQ 0x0400 |
63 | 0 | #define TOK_ID_TGT_REP 0x0401 |
64 | | |
65 | 0 | #define TOK_ID_MIC 0x0404 |
66 | 0 | #define TOK_ID_WRAP 0x0504 |
67 | | #define TOK_ID_MIC_V1 0x0101 |
68 | | #define TOK_ID_WRAP_V1 0x0201 |
69 | | |
70 | 0 | #define GSS_CHECKSUM_TYPE 0x8003 |
71 | | |
72 | | static INLINE BOOL sspi_gss_oid_compare(const WinPrAsn1_OID* oid1, const WinPrAsn1_OID* oid2) |
73 | 0 | { |
74 | 0 | WINPR_ASSERT(oid1); |
75 | 0 | WINPR_ASSERT(oid2); |
76 | | |
77 | 0 | return (oid1->len == oid2->len) && (memcmp(oid1->data, oid2->data, oid1->len) == 0); |
78 | 0 | } Unexecuted instantiation: sspi_winpr.c:sspi_gss_oid_compare Unexecuted instantiation: sspi.c:sspi_gss_oid_compare Unexecuted instantiation: credssp.c:sspi_gss_oid_compare Unexecuted instantiation: ntlm.c:sspi_gss_oid_compare Unexecuted instantiation: kerberos.c:sspi_gss_oid_compare Unexecuted instantiation: negotiate.c:sspi_gss_oid_compare Unexecuted instantiation: schannel.c:sspi_gss_oid_compare Unexecuted instantiation: sspi_gss.c:sspi_gss_oid_compare Unexecuted instantiation: ntlm_message.c:sspi_gss_oid_compare Unexecuted instantiation: schannel_openssl.c:sspi_gss_oid_compare Unexecuted instantiation: ntlm_av_pairs.c:sspi_gss_oid_compare Unexecuted instantiation: ntlm_compute.c:sspi_gss_oid_compare |
79 | | |
80 | | BOOL sspi_gss_wrap_token(SecBuffer* buf, const WinPrAsn1_OID* oid, uint16_t tok_id, |
81 | | const sspi_gss_data* token); |
82 | | BOOL sspi_gss_unwrap_token(const SecBuffer* buf, WinPrAsn1_OID* oid, uint16_t* tok_id, |
83 | | sspi_gss_data* token); |
84 | | |
85 | | #endif /* WINPR_SSPI_GSS_PRIVATE_H */ |