]> Cypherpunks.ru repositories - pyderasn.git/blobdiff - pyderasn.py
Check for OID arc values normalization
[pyderasn.git] / pyderasn.py
index 482b3456cc2eca5e6b5ea3936ee9927a89744d4f..4e9def7bff226e6a53c6b4b4abba12ad3787480b 100755 (executable)
@@ -3228,6 +3228,8 @@ class ObjectIdentifier(Obj):
             arc = 0
             while True:
                 octet = indexbytes(v, i)
+                if i == 0 and octet == 0x80 and not ctx.get("bered", False):
+                    raise DecodeError("non normalized arc encoding")
                 arc = (arc << 7) | (octet & 0x7F)
                 if octet & 0x80 == 0:
                     arcs.append(arc)