-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes: https://github.com/python-ldap/python-ldap/issues/246 https://github.com/python-ldap/python-ldap/pull/299
- Loading branch information
Ondřej Kuzník
authored and
GitHub
committed
Jun 5, 2020
1 parent
c803bfc
commit 9a91bbd
Showing
5 changed files
with
93 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
ldap.extop.passwd - Classes for Password Modify extended operation | ||
(see RFC 3062) | ||
See https://www.python-ldap.org/ for details. | ||
""" | ||
|
||
from ldap.extop import ExtendedResponse | ||
|
||
# Imports from pyasn1 | ||
from pyasn1.type import namedtype, univ, tag | ||
from pyasn1.codec.der import decoder | ||
|
||
|
||
class PasswordModifyResponse(ExtendedResponse): | ||
responseName = None | ||
|
||
class PasswordModifyResponseValue(univ.Sequence): | ||
componentType = namedtype.NamedTypes( | ||
namedtype.OptionalNamedType( | ||
'genPasswd', | ||
univ.OctetString().subtype( | ||
implicitTag=tag.Tag(tag.tagClassContext, | ||
tag.tagFormatSimple, 0) | ||
) | ||
) | ||
) | ||
|
||
def decodeResponseValue(self, value): | ||
respValue, _ = decoder.decode(value, asn1Spec=self.PasswordModifyResponseValue()) | ||
self.genPasswd = bytes(respValue.getComponentByName('genPasswd')) | ||
return self.genPasswd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters