Skip to content
Snippets Groups Projects
Commit 6dd37068 authored by Robbie Harwood's avatar Robbie Harwood Committed by Martin
Browse files

Import Debian changes 1.1.3-1

python-gssapi (1.1.3-1) unstable; urgency=medium
.
  * New upstream release
parents a7053909 91e732d0
No related branches found
No related tags found
No related merge requests found
python-gssapi (1.1.3-1) unstable; urgency=medium
* New upstream release
-- Robbie Harwood (frozencemetery) <rharwood@club.cc.cmu.edu> Fri, 04 Sep 2015 17:39:01 -0400
python-gssapi (1.1.2-1) unstable; urgency=medium
* Initial release. (Closes: #794980)
......
......@@ -51,9 +51,9 @@ copyright = u'2014, The Python-GSSAPI team'
# built documents.
#
# The short X.Y version.
version = '1.1.2'
version = '1.1.3'
# The full version, including alpha/beta/rc tags.
release = '1.1.2'
release = '1.1.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -112,7 +112,7 @@ class Name(rname.Name):
def __unicode__(self):
# Python 2 -- someone asked for unicode
return self.__bytes__().encode(_utils._get_encoding())
return self.__bytes__().decode(_utils._get_encoding())
def __bytes__(self):
# Python 3 -- someone asked for bytes
......@@ -125,6 +125,21 @@ class Name(rname.Name):
This method attempts to display the current :class:`Name`
using the syntax of the given :class:`NameType`, if possible.
Warning:
In MIT krb5 versions below 1.13.3, this method can segfault if
the name was not *originally* created with a `name_type` that was
not ``None`` (even in cases when a ``name_type``
is later "added", such as via :meth:`canonicalize`).
**Do not use this method unless you are sure the above
conditions can never happen in your code.**
Warning:
In addition to the above warning, current versions of MIT krb5 do
not actually fully implement this method, and it may return
incorrect results in the case of canonicalized names.
:requires-ext:`rfc6680`
Args:
......@@ -142,8 +157,8 @@ class Name(rname.Name):
raise NotImplementedError("Your GSSAPI implementation does not "
"support RFC 6680 (the GSSAPI naming "
"extensions)")
return rname_rfc6680.display_name_ext(self, name_type).encode(
_utils.get_encoding())
return rname_rfc6680.display_name_ext(self, name_type).decode(
_utils._get_encoding())
@property
def name_type(self):
......
......@@ -204,7 +204,7 @@ flags=None, lifetime=None, channel_bindings=None, input_token=None)
input_token_buffer.value = input_token
input_token_buffer.length = len(input_token)
cdef gss_OID actual_mech_type
cdef gss_OID actual_mech_type = GSS_C_NO_OID
cdef gss_buffer_desc output_token_buffer = gss_buffer_desc(0, NULL)
cdef OM_uint32 ret_flags
cdef OM_uint32 output_ttl
......@@ -232,7 +232,9 @@ flags=None, lifetime=None, channel_bindings=None, input_token=None)
cdef OID output_mech_type = OID()
if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
output_mech_type.raw_oid = actual_mech_type[0]
if actual_mech_type is not GSS_C_NO_OID:
output_mech_type.raw_oid = actual_mech_type[0]
return InitSecContextResult(output_context, output_mech_type,
IntEnumFlagSet(RequirementFlag, ret_flags),
output_token,
......@@ -362,7 +364,6 @@ channel_bindings=None)
ret_flags),
output_ttl_py, oc,
maj_stat == GSS_S_CONTINUE_NEEDED)
return res
else:
raise GSSError(maj_stat, min_stat, token=output_token)
......
......@@ -396,6 +396,22 @@ class NamesTestCase(_GSSAPIKerberosTestCase):
name2.shouldnt_be_none()
name2.name_type.should_be(gb.NameType.kerberos_principal)
@_extension_test('rfc6680', 'RFC 6680')
def test_display_as(self):
name = gssnames.Name(TARGET_SERVICE_NAME,
gb.NameType.hostbased_service)
canonical_name = name.canonicalize(gb.MechType.kerberos)
# NB(directxman12): krb5 doesn't implement display_name_ext, so just
# check to make sure we return the right types and a reasonable value
krb_name = canonical_name.display_as(
gb.NameType.hostbased_service)
princ_str = SERVICE_PRINCIPAL.decode('utf-8') + '@'
six.text_type(canonical_name).should_be(princ_str)
krb_name.should_be_a(six.text_type)
krb_name.should_be(princ_str)
@_extension_test('rfc6680', 'RFC 6680')
def test_create_from_composite_token_no_attrs(self):
name1 = gssnames.Name(TARGET_SERVICE_NAME,
......
......@@ -208,7 +208,7 @@ long_desc = re.sub('\.\. role:: \w+\(code\)\s*\n\s*.+', '',
setup(
name='gssapi',
version='1.1.2',
version='1.1.3',
author='The Python GSSAPI Team',
author_email='sross@redhat.com',
packages=['gssapi', 'gssapi.raw', 'gssapi.raw._enum_extensions',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment