Skip to content

Commit

Permalink
PR: 2736
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
snhenson committed Feb 27, 2012
1 parent b527b6e commit 250f979
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/asn1/x_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 250f979

Please sign in to comment.