diff options
author | Fredrik Gustafsson <[email protected]> | 2013-11-15 10:54:17 +0100 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-11-15 10:54:17 +0100 |
commit | d7c2b664bee2b869c923ff45f9a95e2f873c05ad (patch) | |
tree | 780f0fa88412c0f4ed353ca428c192f263acc981 /lib/public_key/src | |
parent | 19aedb5c0cb956e51b24fbba4923520efe7bf54b (diff) | |
parent | 51608d139d079cbfb96aeb2d4313132b10d26d3e (diff) | |
download | otp-d7c2b664bee2b869c923ff45f9a95e2f873c05ad.tar.gz otp-d7c2b664bee2b869c923ff45f9a95e2f873c05ad.tar.bz2 otp-d7c2b664bee2b869c923ff45f9a95e2f873c05ad.zip |
Merge branch 'potatosalad/public_key_incorrect_emailaddress/OTP-11470' into maint
* potatosalad/public_key_incorrect_emailaddress/OTP-11470:
public_key_SUITE: Rename id-at-countryName to id-emailAddress
public_key: Workaround for incorrectly encoded utf8 emailAddress
Diffstat (limited to 'lib/public_key/src')
-rw-r--r-- | lib/public_key/src/pubkey_cert_records.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/public_key/src/pubkey_cert_records.erl b/lib/public_key/src/pubkey_cert_records.erl index 0449129809..fdd89aa70d 100644 --- a/lib/public_key/src/pubkey_cert_records.erl +++ b/lib/public_key/src/pubkey_cert_records.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2012. All Rights Reserved. +%% Copyright Ericsson AB 2008-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -67,6 +67,15 @@ transform(#'AttributeTypeAndValue'{type=Id,value=Value0} = ATAV, Func) -> {ok, {printableString, ASCCI}} -> {ok, ASCCI} end; + 'EmailAddress' when Func == decode -> + %% Workaround that some certificates break the ASN-1 spec + %% and encode emailAddress as utf8 + case 'OTP-PUB-KEY':Func('OTP-emailAddress', Value0) of + {ok, {utf8String, Utf8Value}} -> + {ok, unicode:characters_to_list(Utf8Value)}; + {ok, {ia5String, Ia5Value}} -> + {ok, Ia5Value} + end; Type when is_atom(Type) -> 'OTP-PUB-KEY':Func(Type, Value0); _UnknownType -> {ok, Value0} end, |