]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: ecrdsa - fix unknown OID check in ecrdsa_param_curve
authorThorsten Blum <thorsten.blum@linux.dev>
Sat, 2 May 2026 19:09:04 +0000 (21:09 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 7 May 2026 08:10:03 +0000 (16:10 +0800)
commit2d7b2cfc59998baf5e8622a24dc28f69a5212e06
tree2dba1886621130cbaf26b903d090748c9fda4834
parentc04337343ef6e1d5ee5b49ac386e468c2d063e07
crypto: ecrdsa - fix unknown OID check in ecrdsa_param_curve

The ->curve_oid check in ecrdsa_param_curve() rejects the valid enum
value 0 (OID_id_dsa_with_sha1), but look_up_OID() returns OID__NR on
lookup failure. Compare ->curve_oid with OID__NR instead to ensure that
only unknown OIDs return -EINVAL.

Fixes: 0d7a78643f69 ("crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ecrdsa.c