Re: [PATCH 1/2] crypto: use SM3 instead of SM3_256
From: Tianjia Zhang <hidden>
Date: 2021-10-19 09:40:00
Also in:
keyrings, linux-doc, linux-integrity, linux-security-module, lkml
Hi Jarkko, On 10/18/21 9:41 PM, Jarkko Sakkinen wrote:
On Mon, 2021-10-18 at 09:32 -0400, James Bottomley wrote:quoted
On Mon, 2021-10-18 at 16:27 +0300, Jarkko Sakkinen wrote:quoted
On Mon, 2021-10-18 at 09:05 -0400, James Bottomley wrote:quoted
On Sat, 2021-10-09 at 21:08 +0800, Tianjia Zhang wrote: [...]quoted
diff --git a/include/uapi/linux/hash_info.hb/include/uapi/linux/hash_info.h index 74a8609fcb4d..1355525dd4aa 100644--- a/include/uapi/linux/hash_info.h +++ b/include/uapi/linux/hash_info.h@@ -32,7 +32,7 @@ enum hash_algo { HASH_ALGO_TGR_128, HASH_ALGO_TGR_160, HASH_ALGO_TGR_192, - HASH_ALGO_SM3_256, + HASH_ALGO_SM3, HASH_ALGO_STREEBOG_256, HASH_ALGO_STREEBOG_512, HASH_ALGO__LASTThis is another one you can't do: all headers in UAPI are exports to userspace and the definitions constitute an ABI. If you simply do a rename, every userspace program that uses the current definition will immediately break on compile. You could add HASH_ALGO_SM3, but you can't remove HASH_ALGO_SM3_256 JamesSo: shouldn't then also the old symbol continue to work also semantically?Yes, that's the point: you can add a new definition ... in this case an alias for the old one, but you can't remove a definition that's been previously exported.Thanks, this of course obvious :-) I forgot temporarily that crypto has uapi interface. Tianjia, this patch set break production systems, so no chance we would ever merge it in this form. Why not just do this: ... HASH_ALGO_SM3_256, HASH_ALOG_SM3 = HASH_ALOG_SM_256, ... There is not good reason to mod the implementation because both symbols are kept. /Jarkko
Very good suggestion, I will do this in the next version patch. Maybe this is more appropriate: HASH_ALGO_SM3, HASH_ALGO_SM3_256 = HASH_ALGO_SM3, Best regards, Tianjia