3
0
forked from pool/openssl-3
openssl-3/showciphers.c
Pedro Monreal Gonzalez aa970d108e Accepting request 1188975 from home:pmonrealgonzalez:branches:security:tls
- Security fix: [bsc#1227138, CVE-2024-5535]
  * SSL_select_next_proto buffer overread
  * Add openssl-CVE-2024-5535.patch

- Build with enabled sm2 and sm4 support [bsc#1222899]

OBS-URL: https://build.opensuse.org/request/show/1188975
OBS-URL: https://build.opensuse.org/package/show/security:tls/openssl-3?expand=0&rev=106
2024-07-22 09:57:50 +00:00

28 lines
625 B
C

#include <openssl/err.h>
#include <openssl/ssl.h>
int main() {
SSL_CTX *ctx = NULL;
SSL *ssl = NULL;
STACK_OF(SSL_CIPHER) *sk = NULL;
const SSL_METHOD *meth = TLS_server_method();
int i;
const char *p;
ctx = SSL_CTX_new(meth);
if (ctx == NULL)
return 1;
ssl = SSL_new(ctx);
if (ssl == NULL)
return 1;
sk = SSL_get_ciphers(ssl);
for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
const SSL_CIPHER *c = sk_SSL_CIPHER_value(sk, i);
p = SSL_CIPHER_get_name(c);
if (p == NULL)
break;
printf("%s\n", p);
}
return 0;
}