summaryrefslogtreecommitdiffstats
path: root/scan_asn1string.c
diff options
context:
space:
mode:
Diffstat (limited to 'scan_asn1string.c')
-rw-r--r--scan_asn1string.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/scan_asn1string.c b/scan_asn1string.c
new file mode 100644
index 0000000..c409859
--- /dev/null
+++ b/scan_asn1string.c
@@ -0,0 +1,12 @@
+#include "asn1.h"
+
+size_t scan_asn1string(const char* src,const char* max,
+ enum asn1_tagclass* tc,enum asn1_tagtype* tt,unsigned long* tag,
+ const char** s,size_t* l) {
+ size_t len,tmp;
+ if (!(len=scan_asn1tag(src,max,tc,tt,tag))) return 0;
+ if (!(tmp=scan_asn1length(src+len,max,l))) return 0;
+ len+=tmp;
+ *s=src+len;
+ return len+*l;
+}