Lines Matching refs:alg

15 size_t ossl_calculate_comp_expansion(int alg, size_t length)  in ossl_calculate_comp_expansion()  argument
25 switch (alg) { in ossl_calculate_comp_expansion()
60 static OSSL_COMP_CERT *OSSL_COMP_CERT_new(unsigned char *data, size_t len, size_t orig_len, int alg) in OSSL_COMP_CERT_new() argument
64 if (!ossl_comp_has_alg(alg) in OSSL_COMP_CERT_new()
73 ret->alg = alg; in OSSL_COMP_CERT_new()
83 size_t orig_len, int alg) in OSSL_COMP_CERT_from_compressed_data() argument
85 return OSSL_COMP_CERT_new(OPENSSL_memdup(data, len), len, orig_len, alg); in OSSL_COMP_CERT_from_compressed_data()
89 int alg) in OSSL_COMP_CERT_from_uncompressed_data() argument
98 switch (alg) { in OSSL_COMP_CERT_from_uncompressed_data()
112 if ((max_length = ossl_calculate_comp_expansion(alg, len)) == 0 in OSSL_COMP_CERT_from_uncompressed_data()
122 ret = OSSL_COMP_CERT_new(comp_data, comp_length, len, alg); in OSSL_COMP_CERT_from_uncompressed_data()
232 static int ssl_compress_one_cert(SSL *ssl, CERT_PKEY *cpk, int alg) in ssl_compress_one_cert() argument
239 || alg == TLSEXT_comp_cert_none in ssl_compress_one_cert()
240 || !ossl_comp_has_alg(alg)) in ssl_compress_one_cert()
245 comp_cert = OSSL_COMP_CERT_from_uncompressed_data(cert_data, length, alg); in ssl_compress_one_cert()
250 OSSL_COMP_CERT_free(cpk->comp_cert[alg]); in ssl_compress_one_cert()
251 cpk->comp_cert[alg] = comp_cert; in ssl_compress_one_cert()
261 int alg; in ssl_compress_certs() local
275 alg = sc->cert_comp_prefs[i]; in ssl_compress_certs()
276 if ((alg_in == 0 && alg != TLSEXT_comp_cert_none) in ssl_compress_certs()
277 || (alg_in != 0 && alg == alg_in)) { in ssl_compress_certs()
284 if (!ssl_compress_one_cert(ssl, &cpks[j], alg)) in ssl_compress_certs()
288 if (cpks[j].comp_cert[alg]->len >= cpks[j].comp_cert[alg]->orig_len) { in ssl_compress_certs()
289 OSSL_COMP_CERT_free(cpks[j].comp_cert[alg]); in ssl_compress_certs()
290 cpks[j].comp_cert[alg] = NULL; in ssl_compress_certs()
300 static size_t ssl_get_compressed_cert(SSL *ssl, CERT_PKEY *cpk, int alg, unsigned char **data, in ssl_get_compressed_cert() argument
315 || !ossl_comp_has_alg(alg)) in ssl_get_compressed_cert()
321 comp_cert = OSSL_COMP_CERT_from_uncompressed_data(cert_data, cert_len, alg); in ssl_get_compressed_cert()
382 int SSL_compress_certs(SSL *ssl, int alg) in SSL_compress_certs() argument
390 return ssl_compress_certs(ssl, sc->cert->pkeys, alg); in SSL_compress_certs()
395 int SSL_CTX_compress_certs(SSL_CTX *ctx, int alg) in SSL_CTX_compress_certs() argument
404 ret = ssl_compress_certs(new, ctx->cert->pkeys, alg); in SSL_CTX_compress_certs()
410 size_t SSL_get1_compressed_cert(SSL *ssl, int alg, unsigned char **data, size_t *orig_len) in SSL_get1_compressed_cert() argument
421 return ssl_get_compressed_cert(ssl, cpk, alg, data, orig_len); in SSL_get1_compressed_cert()
427 size_t SSL_CTX_get1_compressed_cert(SSL_CTX *ctx, int alg, unsigned char **data, size_t *orig_len) in SSL_CTX_get1_compressed_cert() argument
433 ret = ssl_get_compressed_cert(new, ctx->cert->key, alg, data, orig_len); in SSL_CTX_get1_compressed_cert()