summaryrefslogtreecommitdiffstats
path: root/fmt_asn1string.c
diff options
context:
space:
mode:
authorSimon Rettberg2014-03-15 01:49:50 +0100
committerSimon Rettberg2014-03-15 01:49:50 +0100
commitbedd2e7ccb1595c23e159eaa952ae1b0b5a3d2ad (patch)
treec7d1995a09f6ed0c4e6873252e957d72f5d07d07 /fmt_asn1string.c
downloadldadp-bedd2e7ccb1595c23e159eaa952ae1b0b5a3d2ad.tar.gz
ldadp-bedd2e7ccb1595c23e159eaa952ae1b0b5a3d2ad.tar.xz
ldadp-bedd2e7ccb1595c23e159eaa952ae1b0b5a3d2ad.zip
Lean and mean initial commit
Not much functionality yet
Diffstat (limited to 'fmt_asn1string.c')
-rw-r--r--fmt_asn1string.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fmt_asn1string.c b/fmt_asn1string.c
new file mode 100644
index 0000000..e0ef6ac
--- /dev/null
+++ b/fmt_asn1string.c
@@ -0,0 +1,10 @@
+#include "asn1.h"
+#include "byte.h"
+
+size_t fmt_asn1string(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,enum asn1_tag tag,const char* c,size_t l) {
+ size_t len;
+ if (l>(size_t)-100) return (size_t)-1;
+ len=fmt_asn1transparent(dest,tc,tt,tag,l);
+ if (dest) byte_copy(dest+len,l,c);
+ return len+l;
+}