true is encoded as 0xff, not 1 (thanks Christian Ullrich)

This commit is contained in:
leitner
2023-09-03 17:50:19 +00:00
parent c41cd9658c
commit f6952c5cd2

View File

@@ -8,7 +8,7 @@ size_t scan_asn1BOOLEAN(const char* src,const char* max,unsigned long* val) {
long ltmp;
if ((tmp=scan_asn1int(src,max,&tc,&tt,&tag,&ltmp)))
if (tc==UNIVERSAL && tt==PRIMITIVE && tag==BOOLEAN) {
if (ltmp!=0 && ltmp!=1) return 0;
if (ltmp!=0 && ltmp!=255) return 0;
*val=(unsigned long)ltmp;
return tmp;
}