forked from geertj/python-asn1
-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
Hi, i use asn1 to implement spnego, which worked for version 2.8.0, after i upgraded to 3.0.0, it stopped working because the new version leave() function appends b'\x00\x00'. the below code is an example to demonstrate the difference, please help if there is any wrong usage in the code.
import asn1
GENSEC_OID_SPNEGO = "1.3.6.1.5.5.2"
def encode_spnego():
encoder = asn1.Encoder()
encoder.start()
encoder.enter(0, asn1.Classes.Application)
encoder.write(GENSEC_OID_SPNEGO, asn1.Numbers.ObjectIdentifier)
encoder.leave()
out = encoder.output()
print("Encoded SPNEGO: %d" % len(out))
if __name__ == "__main__":
encode_spnego()