From 086e8790db3a4ad9d48e538a23286c2657daa602 Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 18 Jan 2002 13:41:40 +0000 Subject: [PATCH] fmt_asn1tag didn't set the high bit for the multibyte encoding --- THANKS | 1 + fmt_asn1tag.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 THANKS diff --git a/THANKS b/THANKS new file mode 100644 index 0000000..4ec23e7 --- /dev/null +++ b/THANKS @@ -0,0 +1 @@ +Trevor Harrison found a bug in fmt_asn1tag for the multibyte encoding. diff --git a/fmt_asn1tag.c b/fmt_asn1tag.c index de147e6..aa569dc 100644 --- a/fmt_asn1tag.c +++ b/fmt_asn1tag.c @@ -18,7 +18,7 @@ int fmt_asn1tag(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,unsigned l *dest=(int)tc+(int)tt+0x1f; ++dest; while (j) { --j; - *dest=((l>>(j*7))&0x7f); + *dest=((l>>(j*7))&0x7f) + (j?0x80:0); ++dest; } }