summaryrefslogtreecommitdiffstats
path: root/CryptoPkg/Include
diff options
context:
space:
mode:
authorLong Qin <qin.long@intel.com>2018-05-24 16:08:51 +0800
committerLong Qin <qin.long@intel.com>2018-06-05 10:16:03 +0800
commit0b6457efabf6f47bc55690874dde82d2f8616abc (patch)
treefbb9598693698629020b08d606400639fa56eb3b /CryptoPkg/Include
parent38c977c148e92e2af17c5d346d9b4b2e7a18680a (diff)
downloadedk2-0b6457efabf6f47bc55690874dde82d2f8616abc.tar.gz
edk2-0b6457efabf6f47bc55690874dde82d2f8616abc.tar.bz2
edk2-0b6457efabf6f47bc55690874dde82d2f8616abc.zip
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>
Diffstat (limited to 'CryptoPkg/Include')
-rw-r--r--CryptoPkg/Include/Library/BaseCryptLib.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/CryptoPkg/Include/Library/BaseCryptLib.h b/CryptoPkg/Include/Library/BaseCryptLib.h
index 027ea09feb..dc6aaf0635 100644
--- a/CryptoPkg/Include/Library/BaseCryptLib.h
+++ b/CryptoPkg/Include/Library/BaseCryptLib.h
@@ -4,7 +4,7 @@
primitives (Hash Serials, HMAC, RSA, Diffie-Hellman, etc) for UEFI security
functionality enabling.
-Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -2177,7 +2177,7 @@ X509GetSubjectName (
@param[in] Cert Pointer to the DER-encoded X509 certificate.
@param[in] CertSize Size of the X509 certificate in bytes.
@param[out] CommonName Buffer to contain the retrieved certificate common
- name string. At most CommonNameSize bytes will be
+ name string (UTF8). At most CommonNameSize bytes will be
written and the string will be null terminated. May be
NULL in order to determine the size buffer needed.
@param[in,out] CommonNameSize The size in bytes of the CommonName buffer on input,