1
+ """
2
+ GGF Extensions
3
+
4
+ GGF provides extended credential and security context inquiry that allows
5
+ application to retrieve more information about the client's credentials and
6
+ security context. One common use case is to use gss_inquire_sec_context_by_oid
7
+ to retrieve the "session" key that is required by the SMB protocol for signing
8
+ and encrypting a message. These calls are provided as a part of the raw
9
+ interface and are not exposed in the high-level interface.
10
+
11
+ Draft IETF document for these extensions can be found at
12
+ https://tools.ietf.org/html/draft-engert-ggf-gss-extensions-00
13
+ """
1
14
GSSAPI= " BASE" # This ensures that a full module is generated by Cython
2
15
3
16
from gssapi.raw.cython_types cimport *
@@ -21,20 +34,21 @@ cdef extern from "python_gssapi_ext.h":
21
34
gss_buffer_set_t * data_set) nogil
22
35
23
36
24
- def inquire_cred_by_oid (Creds cred_handle not None , OID mech not None ):
37
+ def inquire_cred_by_oid (Creds cred_handle not None ,
38
+ OID desired_aspect not None ):
25
39
"""
26
- inquire_cred_by_oid(cred_handle, mech )
40
+ inquire_cred_by_oid(cred_handle, desired_aspect )
27
41
28
42
This method inspects a :class:`Creds` object for information
29
- specific to a particular mechanism .
43
+ specific to a particular desired aspect as an OID .
30
44
31
45
Args:
32
- cred_handle (Creds): the security context to query
33
- mech (OID): the desired mechanism
46
+ cred_handle (Creds): the Credentials to query
47
+ desired_aspect (OID): the desired aspect of the Credentials to inquire
48
+ about.
34
49
35
50
Returns:
36
- list: A list of zero or more pieces of data corresponding to the
37
- OID set
51
+ list: A list of zero or more pieces of data (as bytes objects)
38
52
39
53
Raises:
40
54
GSS_ERROR
@@ -48,7 +62,7 @@ def inquire_cred_by_oid(Creds cred_handle not None, OID mech not None):
48
62
49
63
with nogil:
50
64
maj_stat = gss_inquire_cred_by_oid(& min_stat, cred_handle.raw_creds,
51
- & mech .raw_oid, data_set_ptr)
65
+ & desired_aspect .raw_oid, data_set_ptr)
52
66
53
67
if maj_stat == GSS_S_COMPLETE:
54
68
py_tokens = []
@@ -66,24 +80,24 @@ def inquire_cred_by_oid(Creds cred_handle not None, OID mech not None):
66
80
67
81
68
82
def inquire_sec_context_by_oid (SecurityContext context not None ,
69
- OID mech not None ):
83
+ OID desired_aspect not None ):
70
84
"""
71
- inquire_sec_context_by_oid(context, mech )
85
+ inquire_sec_context_by_oid(context, desired_aspect )
72
86
73
87
This method inspects a :class:`SecurityContext` object for information
74
- specific to a particular mechanism .
88
+ specific to a particular desired aspect as an OID .
75
89
76
90
This method can be used with the GSS_KRB5_INQ_SSPI_SESSION_KEY_OID OID to
77
91
retrieve the required key that is used to derive the SMB/SAMBA signing and
78
92
encryption keys.
79
93
80
94
Args:
81
- context (SecurityContext): the security context to query
82
- mech (OID): the desired mechanism
95
+ context (SecurityContext): the Security Context to query
96
+ desired_aspect (OID): the desired aspected of the Security Context to
97
+ inquire about.
83
98
84
99
Returns:
85
- list: A list of zero or more pieces of data corresponding to the
86
- OID set
100
+ list: A list of zero or more pieces of data (as bytes objects)
87
101
88
102
Raises:
89
103
GSS_ERROR
@@ -97,7 +111,8 @@ def inquire_sec_context_by_oid(SecurityContext context not None,
97
111
98
112
with nogil:
99
113
maj_stat = gss_inquire_sec_context_by_oid(& min_stat, context.raw_ctx,
100
- & mech.raw_oid, data_set_ptr)
114
+ & desired_aspect.raw_oid,
115
+ data_set_ptr)
101
116
102
117
if maj_stat == GSS_S_COMPLETE:
103
118
py_tokens = []
0 commit comments