add oid and bitstring parsing and formatting to "generic" format string
routines, test them in t10.c
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
#include "asn1.h"
|
||||
|
||||
size_t fmt_asn1OID(char* dest,const unsigned long* array,unsigned long len) {
|
||||
size_t fmt_asn1OID(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,enum asn1_tag tag,const unsigned long* array,unsigned long len) {
|
||||
size_t i,l,l2;
|
||||
if (len<2) return 0;
|
||||
for (l=1,i=2; i<len; ++i) {
|
||||
l+=fmt_asn1tagint(dest,array[i]);
|
||||
}
|
||||
l2=fmt_asn1transparent(dest,UNIVERSAL,PRIMITIVE,OBJECT_IDENTIFIER,l);
|
||||
l2=fmt_asn1transparent(dest,tc,tt,tag,l);
|
||||
if (!dest) return l+l2;
|
||||
dest[l2]=array[0]*40+array[1];
|
||||
dest+=l2+1;
|
||||
|
||||
Reference in New Issue
Block a user