summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsteve <steve>2012-02-27 18:45:28 +0000
committersteve <steve>2012-02-27 18:45:28 +0000
commit4f10cee2f48a7ae231b1c93cbad1bdb68fd3b3c9 (patch)
treebbd150c297fd1cb9431b9896806fa5cd0ee89fd1
parentcbff6dd5f2d248fd498d1c840497637332b80f8d (diff)
downloadopenssl-4f10cee2f48a7ae231b1c93cbad1bdb68fd3b3c9.tar.gz
PR: 2736
Reported by: Remi Gacogne <rgacogne-bugs@coredump.fr> Preserve unused bits value in non-canonicalised ASN1_STRING structures by using ASN1_STRING_copy which preseves flags.
-rw-r--r--crypto/asn1/x_name.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/asn1/x_name.c b/crypto/asn1/x_name.c
index 49be08b4d..d7c231869 100644
--- a/crypto/asn1/x_name.c
+++ b/crypto/asn1/x_name.c
@@ -399,8 +399,7 @@ static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in)
/* If type not in bitmask just copy string across */
if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON))
{
- out->type = in->type;
- if (!ASN1_STRING_set(out, in->data, in->length))
+ if (!ASN1_STRING_copy(out, in))
return 0;
return 1;
}