mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-18 20:49:28 +00:00
Harvest 176 isolated vuln-vs-fix functions (109 CVEs, 352 training rows) into benchmarks/pairs/vfc with provenance and a JSONL training manifest. Score the slice as an honesty dashboard (ousast pairs --slice vfc); keep the pair gate on the local fixtures only.
37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
/* Provenance: openssl/openssl alpn_select_cb (fixed).
|
|
* repo: openssl/openssl
|
|
* commit: 6cc511826f09e513b4ec066d9b95acaf4f86d991
|
|
* parent: 015255851371757d54c2560643eb3b3a88123cf1
|
|
* commit_url: https://github.com/openssl/openssl/commit/6cc511826f09e513b4ec066d9b95acaf4f86d991
|
|
* cve: CVE-2024-5535
|
|
* license: Apache-2.0
|
|
* function: alpn_select_cb
|
|
* relpath: ssl/quic/quic_tserver.c
|
|
*/
|
|
|
|
static int alpn_select_cb(SSL *ssl, const unsigned char **out,
|
|
unsigned char *outlen, const unsigned char *in,
|
|
unsigned int inlen, void *arg)
|
|
{
|
|
QUIC_TSERVER *srv = arg;
|
|
static const unsigned char alpndeflt[] = {
|
|
8, 'o', 's', 's', 'l', 't', 'e', 's', 't'
|
|
};
|
|
static const unsigned char *alpn;
|
|
size_t alpnlen;
|
|
|
|
if (srv->args.alpn == NULL) {
|
|
alpn = alpndeflt;
|
|
alpnlen = sizeof(alpndeflt);
|
|
} else {
|
|
alpn = srv->args.alpn;
|
|
alpnlen = srv->args.alpnlen;
|
|
}
|
|
|
|
if (SSL_select_next_proto((unsigned char **)out, outlen, alpn, alpnlen,
|
|
in, inlen) != OPENSSL_NPN_NEGOTIATED)
|
|
return SSL_TLSEXT_ERR_ALERT_FATAL;
|
|
|
|
return SSL_TLSEXT_ERR_OK;
|
|
}
|