aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_asn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl_asn1.c')
-rw-r--r--ext/openssl/ossl_asn1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index 842c5b54..87342d68 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -1177,6 +1177,11 @@ ossl_asn1cons_to_der(VALUE self)
for (i = 0; i < RARRAY_LEN(ary); i++) {
VALUE item = RARRAY_AREF(ary, i);
+ if (indef_len && rb_obj_is_kind_of(item, cASN1EndOfContent)) {
+ if (i != RARRAY_LEN(ary) - 1)
+ ossl_raise(eASN1Error, "illegal EOC octets in value");
+ }
+
item = ossl_to_der_if_possible(item);
StringValue(item);
rb_str_append(str, item);