Pierre De Boeck wrote:
>
> Hi all,
>
> I had a little problem with the pkcs12 library.
>
> When I added a friendly-name attibute in a PKCS12_SAFEBAG
> SafeBag object (for a certificate or a shrouded
> PKCS8 key), it works well except that when I imported
> the pfx file into IE 5.x, the friendly-name attribute
> was displayed with garbage characters at the end.
>
> Apparently it was due to the following line in
> PKCS12_add_friendlyname_uni:
>
> if(!name[namelen - 1] && !name[namelen - 2]) namelen -= 2;
>
> This code remove the double null if included, as said by the comment
> above it.
>
> When I comment that line, all is fine. So what was the reason for this
> "zapping"?
>
Sigh, yet another MS bug. The reason for this "zapping" is that the a
BMPString should not include the double null terminator in its encoding.
Steve.
--
Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]