Browse Source

fix der_decode_object_identifier()

Steffen Jaeckel 7 years ago
parent
commit
4ffdb915f0

+ 7 - 2
src/pk/asn1/der/object_identifier/der_decode_object_identifier.c

@@ -71,8 +71,13 @@ int der_decode_object_identifier(const unsigned char *in,    unsigned long  inle
             y++;
             y++;
          } else {
          } else {
             if (y == 0) {
             if (y == 0) {
-               words[0] = t / 40;
-               words[1] = t % 40;
+               if (t <= 79) {
+                  words[0] = t / 40;
+                  words[1] = t % 40;
+               } else {
+                  words[0] = 2;
+                  words[1] = t - 80;
+               }
                y = 2;
                y = 2;
             } else {
             } else {
                words[y++] = t;
                words[y++] = t;