From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web12.6364.1579166012562840249 for ; Thu, 16 Jan 2020 01:13:32 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BW+qdSaq; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579166011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oMzG2cuB84t8BtKdm2Lek1Gm+Vr54ZZ6BGiW6N0KUUw=; b=BW+qdSaqHaCGbJ5DtL8cBL6AwTQWtxfzNK9SGI96wiuUy1pPqMFofhx9g5meyrv0VrldK7 93LzxWvhNsUuqVWc0lA1Opb8XOEkR92uabO0jFen/cVouJqIjaDVzJyG83MmYJKo6I41cS JfUJ6PxqFmzGz30k2i9EDQF3X2QMwCw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-67-3UOcp-ksPBe82NmZqi2_UQ-1; Thu, 16 Jan 2020 04:13:25 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EEC48107ACC9; Thu, 16 Jan 2020 09:13:23 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-120.ams2.redhat.com [10.36.116.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14442101F942; Thu, 16 Jan 2020 09:13:22 +0000 (UTC) Subject: Re: [PATCH v3 2/2] CryptoPkg/BaseCryptLib: remove HmacXxxGetContextSize interface To: Jian J Wang , devel@edk2.groups.io Cc: Xiaoyu Lu References: <20200116061004.636-1-jian.j.wang@intel.com> <20200116061004.636-3-jian.j.wang@intel.com> From: "Laszlo Ersek" Message-ID: Date: Thu, 16 Jan 2020 10:13:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200116061004.636-3-jian.j.wang@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: 3UOcp-ksPBe82NmZqi2_UQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 01/16/20 07:10, Jian J Wang wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1792 > > Hmac(Md5|Sha1|Sha256)GetContextSize() use a deprecated macro > HMAC_MAX_MD_CBLOCK defined in openssl. They should be dropped to > avoid misuses in the future. For context allocation and release, > use HmacXxxNew() and HmacXxxFree() instead. > > Cc: Xiaoyu Lu > Cc: Laszlo Ersek > Signed-off-by: Jian J Wang > --- > CryptoPkg/Include/Library/BaseCryptLib.h | 17 ---------- > .../Library/BaseCryptLib/Hmac/CryptHmacMd5.c | 31 ------------------ > .../BaseCryptLib/Hmac/CryptHmacMd5Null.c | 20 ------------ > .../Library/BaseCryptLib/Hmac/CryptHmacSha1.c | 32 ------------------- > .../BaseCryptLib/Hmac/CryptHmacSha1Null.c | 20 ------------ > .../BaseCryptLib/Hmac/CryptHmacSha256.c | 31 ------------------ > .../BaseCryptLib/Hmac/CryptHmacSha256Null.c | 20 ------------ > .../BaseCryptLibNull/Hmac/CryptHmacMd5Null.c | 20 ------------ > .../BaseCryptLibNull/Hmac/CryptHmacSha1Null.c | 20 ------------ > .../Hmac/CryptHmacSha256Null.c | 20 ------------ > 10 files changed, 231 deletions(-) > > diff --git a/CryptoPkg/Include/Library/BaseCryptLib.h b/CryptoPkg/Include/Library/BaseCryptLib.h > index c5803ea673..09fed8b041 100644 > --- a/CryptoPkg/Include/Library/BaseCryptLib.h > +++ b/CryptoPkg/Include/Library/BaseCryptLib.h > @@ -1025,23 +1025,6 @@ Sm3HashAll ( > // MAC (Message Authentication Code) Primitive > //===================================================================================== > > -/** > - Retrieves the size, in bytes, of the context buffer required for HMAC-MD5 operations. > - (NOTE: This API is deprecated. > - Use HmacMd5New() / HmacMd5Free() for HMAC-MD5 Context operations.) > - > - If this interface is not supported, then return zero. > - > - @return The size, in bytes, of the context buffer required for HMAC-MD5 operations. > - @retval 0 This interface is not supported. > - > -**/ > -UINTN > -EFIAPI > -HmacMd5GetContextSize ( > - VOID > - ); > - > /** > Allocates and initializes one HMAC_CTX context for subsequent HMAC-MD5 use. > (1) So, according to my review for patch#1, the declarations of the functions: - HmacSha1GetContextSize() - HmacSha256GetContextSize() should be removed from the lib class header in *this* patch (i.e., patch#2), similarly to how HmacMd5GetContextSize() is removed, seen just above in the quote. With (1) fixed: Reviewed-by: Laszlo Ersek Thanks! Laszlo