]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: jws: conversion to NIST curves name
authorWilliam Lallemand <wlallemand@haproxy.com>
Sat, 1 Mar 2025 22:58:48 +0000 (23:58 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 3 Mar 2025 11:43:32 +0000 (12:43 +0100)
commitcf71e9f5cf958f4b87200726b91e13b6093705bf
treedc201afce10f713a83ee560ca667a367b592bc8b
parent8a6b0b06cdead9c6667b7d3715a6a042f09698a9
MINOR: jws: conversion to NIST curves name

OpenSSL version greater than 3.0 does not use the same API when
manipulating EVP_PKEY structures, the EC_KEY API is deprecated and it's
not possible anymore to get an EC_GROUP and simply call
EC_GROUP_get_curve_name().

Instead, one must call EVP_PKEY_get_utf8_string_param with the
OSSL_PKEY_PARAM_GROUP_NAME parameter, but this would result in a SECG
curves name, instead of a NIST curves name in previous version.
(ex: secp384r1 vs P-384)

This patch adds 2 functions:

- the first one look for a curves name and converts it to an openssl
  NID.

- the second one converts a NID to a NIST curves name

The list only contains: P-256, P-384 and P-521 for now, it could be
extended in the fure with more curves.
src/jws.c