]> git.proxmox.com Git - mirror_edk2.git/commit
CryptoPkg: Remove deprecated function usage in X509GetCommonName()
authorLong Qin <qin.long@intel.com>
Thu, 24 May 2018 08:08:51 +0000 (16:08 +0800)
committerLong Qin <qin.long@intel.com>
Tue, 5 Jun 2018 02:16:03 +0000 (10:16 +0800)
commit0b6457efabf6f47bc55690874dde82d2f8616abc
treefbb9598693698629020b08d606400639fa56eb3b
parent38c977c148e92e2af17c5d346d9b4b2e7a18680a
CryptoPkg: Remove deprecated function usage in X509GetCommonName()

BZ#: https://bugzilla.tianocore.org/show_bug.cgi?id=923

X509_NAME_get_text_by_NID() used in X509GetCommonName() implementation
is one legacy function which have various limitations. The returned
data may be not usable  when the target cert contains multicharacter
string type like a BMPString or a UTF8String.
This patch replaced the legacy function usage with more general
X509_NAME_get_index_by_NID() / X509_NAME_get_entry() APIs for X509
CommonName retrieving.

Tests: Validated the commonName retrieving with test certificates
       containing PrintableString or BMPString data.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Long Qin <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
CryptoPkg/Include/Library/BaseCryptLib.h
CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c
CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c