summaryrefslogtreecommitdiff
path: root/lib/coding.c
diff options
context:
space:
mode:
authorFabio Fiorina <fiorinaf@gnutls.org>2002-10-03 20:09:09 +0000
committerFabio Fiorina <fiorinaf@gnutls.org>2002-10-03 20:09:09 +0000
commitb687da6a3823a82b332548083bb31c7fca4bf82f (patch)
tree22279cb397bcb152e8661e27b20d582de2245369 /lib/coding.c
parenta73e3dbed8123d6aeb97e4ad9f991ed88d06129d (diff)
downloadlibtasn1-b687da6a3823a82b332548083bb31c7fca4bf82f.tar.gz
libtasn1-b687da6a3823a82b332548083bb31c7fca4bf82f.tar.bz2
libtasn1-b687da6a3823a82b332548083bb31c7fca4bf82f.zip
add GeneralString type
Diffstat (limited to 'lib/coding.c')
-rw-r--r--lib/coding.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/coding.c b/lib/coding.c
index 1b9cbfd..685a124 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -435,6 +435,9 @@ _asn1_insert_tag_der(node_asn *node,unsigned char *der,int *counter)
case TYPE_OCTET_STRING:
_asn1_tag_der(UNIVERSAL,TAG_OCTET_STRING,der+*counter,&tag_len);
break;
+ case TYPE_GENERALSTRING:
+ _asn1_tag_der(UNIVERSAL,TAG_GENERALSTRING,der+*counter,&tag_len);
+ break;
case TYPE_BIT_STRING:
_asn1_tag_der(UNIVERSAL,TAG_BIT_STRING,der+*counter,&tag_len);
break;
@@ -735,6 +738,12 @@ asn1_der_coding(ASN1_TYPE element,const char *name,unsigned char *der,int *len,
counter+=len3+len2;
move=RIGHT;
break;
+ case TYPE_GENERALSTRING:
+ len2=_asn1_get_length_der(p->value,&len3);
+ memcpy(der+counter,p->value,len3+len2);
+ counter+=len3+len2;
+ move=RIGHT;
+ break;
case TYPE_BIT_STRING:
len2=_asn1_get_length_der(p->value,&len3);
memcpy(der+counter,p->value,len3+len2);