mirror of https://github.com/secdev/scapy.git
Fix BERcodec_STRING
This commit is contained in:
parent
aa11c749d5
commit
3cdd54092c
|
@ -337,7 +337,8 @@ class BERcodec_STRING(BERcodec_Object):
|
||||||
tag = ASN1_Class_UNIVERSAL.STRING
|
tag = ASN1_Class_UNIVERSAL.STRING
|
||||||
@classmethod
|
@classmethod
|
||||||
def enc(cls,s):
|
def enc(cls,s):
|
||||||
return chb(hash(cls.tag))+BER_len_enc(len(s))+raw(s) # Be sure we are encoding bytes
|
s = raw(s)
|
||||||
|
return chb(hash(cls.tag))+BER_len_enc(len(s))+s # Be sure we are encoding bytes
|
||||||
@classmethod
|
@classmethod
|
||||||
def do_dec(cls, s, context=None, safe=False):
|
def do_dec(cls, s, context=None, safe=False):
|
||||||
l,s,t = cls.check_type_check_len(s)
|
l,s,t = cls.check_type_check_len(s)
|
||||||
|
|
Loading…
Reference in New Issue