Codebase list libcryptx-perl / 53c10db
ASN.1 context specific tag (decoding) Karel Miko 10 years ago
2 changed file(s) with 15 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
485485 /** Flag used to indicate optional items in ASN.1 sequences */
486486 int optional;
487487 /** Flag used to indicate context specific tags on ASN.1 sequence items */
488 int tag;
488 unsigned char tag;
489489 /** prev/next entry in the list */
490490 struct ltc_asn1_list_ *prev, *next, *child, *parent;
491491 } ltc_asn1_list;
9090
9191 if (type == LTC_ASN1_EOL) {
9292 break;
93 }
94
95 /* handle context specific tags - just skip the tag + len bytes */
96 z = 0;
97 if (list[i].tag > 0 && list[i].tag == in[x + z++]) {
98 if (in[x+z] & 0x80) {
99 y = in[x + z++] & 0x7F;
100 if (y == 0 || y > 2) { return CRYPT_INVALID_PACKET; }
101 z += y;
102 } else {
103 z++;
104 }
105 x += z;
106 inlen -= z;
93107 }
94108
95109 switch (type) {