BUILD: acme: acme_gen_tmp_x509() signedness and unused variables

Fix compilation issues in acme_gen_tmp_x509().

src/acme.c:2665:66: warning: pointer targets in passing argument 4 of ‘X509_NAME_add_entry_by_txt’ differ in signedness [-Wpointer-sign]
 2665 |         if (X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, "expired",
      |                                                                  ^~~~~~~~~
      |                                                                  |
      |                                                                  char *
In file included from /usr/include/openssl/ssl.h:32,
                 from include/haproxy/openssl-compat.h:19,
                 from include/haproxy/acme-t.h:6,
                 from src/acme.c:16:
/usr/include/openssl/x509.h:1074:53: note: expected ‘const unsigned char *’ but argument is of type ‘char *’
 1074 |                                const unsigned char *bytes, int len, int loc,
      |                                ~~~~~~~~~~~~~~~~~~~~~^~~~~
src/acme.c:2630:23: warning: unused variable ‘i’ [-Wunused-variable]
 2630 |         unsigned int  i;
      |                       ^
src/acme.c:2629:23: warning: unused variable ‘ctx’ [-Wunused-variable]
 2629 |         X509V3_CTX    ctx;
      |                       ^~~
This commit is contained in:
William Lallemand 2025-11-06 12:06:57 +01:00
parent a15d4f5b19
commit 0524af034f

View File

@ -2626,8 +2626,6 @@ X509 *acme_gen_tmp_x509()
X509 *newcrt = NULL; X509 *newcrt = NULL;
X509_NAME *name; X509_NAME *name;
const EVP_MD *digest; const EVP_MD *digest;
X509V3_CTX ctx;
unsigned int i;
CONF *ctmp = NULL; CONF *ctmp = NULL;
int key_type; int key_type;
EVP_PKEY *pkey = tmp_pkey; EVP_PKEY *pkey = tmp_pkey;
@ -2662,7 +2660,7 @@ X509 *acme_gen_tmp_x509()
goto mkcert_error; goto mkcert_error;
/* Set the subject name using the servername but the CN */ /* Set the subject name using the servername but the CN */
if (X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, "expired", if (X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC, (unsigned char *)"expired",
-1, -1, 0) != 1) { -1, -1, 0) != 1) {
X509_NAME_free(name); X509_NAME_free(name);
goto mkcert_error; goto mkcert_error;