aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/asn1_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/asn1/asn1_lib.c')
-rw-r--r--crypto/asn1/asn1_lib.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c
index 0638870ab7..3f7b3aad2a 100644
--- a/crypto/asn1/asn1_lib.c
+++ b/crypto/asn1/asn1_lib.c
@@ -203,13 +203,22 @@ void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
}
p += ttag;
}
- if ((constructed == 2) && (length == 0))
- *(p++)=0x80; /* der_put_length would output 0 instead */
+ if (constructed == 2)
+ *(p++)=0x80;
else
asn1_put_length(&p,length);
*pp=p;
}
+int ASN1_put_eoc(unsigned char **pp)
+ {
+ unsigned char *p = *pp;
+ *p++ = 0;
+ *p++ = 0;
+ *pp = p;
+ return 2;
+ }
+
static void asn1_put_length(unsigned char **pp, int length)
{
unsigned char *p= *pp;
@@ -247,8 +256,8 @@ int ASN1_object_size(int constructed, int length, int tag)
ret++;
}
}
- if ((length == 0) && (constructed == 2))
- ret+=2;
+ if (constructed == 2)
+ return ret + 3;
ret++;
if (length > 127)
{