asn1_length fixed.

This commit is contained in:
William Grant
2011-03-19 18:54:31 +11:00
parent be1368f374
commit e220d2da1d
+2 -2
View File
@@ -101,9 +101,9 @@ def asn1_length(n):
assert n >= 0 assert n >= 0
if n < 0x7f: if n < 0x7f:
return chr(n) return chr(n)
r = "" r = bytearray()
while n > 0: while n > 0:
r = chr(n & 0xff) + r r.insert(n & 0xff)
n >>= 8 n >>= 8
return r return r