Skip to content

Commit 4ffdb91

Browse files
committed
fix der_decode_object_identifier()
1 parent 079ed04 commit 4ffdb91

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/pk/asn1/der/object_identifier/der_decode_object_identifier.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,13 @@ int der_decode_object_identifier(const unsigned char *in, unsigned long inle
7171
y++;
7272
} else {
7373
if (y == 0) {
74-
words[0] = t / 40;
75-
words[1] = t % 40;
74+
if (t <= 79) {
75+
words[0] = t / 40;
76+
words[1] = t % 40;
77+
} else {
78+
words[0] = 2;
79+
words[1] = t - 80;
80+
}
7681
y = 2;
7782
} else {
7883
words[y++] = t;

0 commit comments

Comments
 (0)