]> git.ipfire.org Git - thirdparty/openssl.git/blame - apps/include/s_apps.h
Copyright year updates
[thirdparty/openssl.git] / apps / include / s_apps.h
CommitLineData
846e33c7 1/*
da1c088f 2 * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
a661b653 3 *
dffa7520 4 * Licensed under the Apache License 2.0 (the "License"). You may not use
846e33c7
RS
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
a661b653 8 */
846e33c7 9
bc36ee62
RL
10#include <openssl/opensslconf.h>
11
d0cf719e 12#include <openssl/ssl.h>
6d2a1eff 13#include <openssl/srp.h>
3d7c4a5a 14
ab69ac00 15#define PORT "4433"
d02b48c6
RE
16#define PROTOCOL "tcp"
17
af5e63e1
FG
18#define SSL_VERSION_ALLOWS_RENEGOTIATION(s) \
19 (SSL_is_dtls(s) || (SSL_version(s) < TLS1_3_VERSION))
20
72d0bc84 21typedef int (*do_server_cb)(int s, int stype, int prot, unsigned char *context);
4599ea9f 22void get_sock_info_address(int asock, char **hostname, char **service);
d63053bb 23int report_server_accept(BIO *out, int asock, int with_address, int with_pid);
ab69ac00 24int do_server(int *accept_sock, const char *host, const char *port,
5540eb70 25 int family, int type, int protocol, do_server_cb cb,
a3e53d56
TS
26 unsigned char *context, int naccept, BIO *bio_s_out,
27 int tfo);
6d23cf97 28int verify_callback(int ok, X509_STORE_CTX *ctx);
d0cf719e 29
d02b48c6 30int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file);
fc6fc7ff 31int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key,
0f113f3e 32 STACK_OF(X509) *chain, int build_chain);
9f27b1ee 33int ssl_print_sigalgs(BIO *out, SSL *s);
20b431e3 34int ssl_print_point_formats(BIO *out, SSL *s);
de4d764e 35int ssl_print_groups(BIO *out, SSL *s, int noshared);
33a8de69 36int ssl_print_tmp_key(BIO *out, SSL *s);
ab69ac00 37int init_client(int *sock, const char *host, const char *port,
ebc01683 38 const char *bindhost, const char *bindport,
f34e5d7a 39 int family, int type, int protocol, int tfo, int doconn,
a3e53d56 40 BIO_ADDR **ba_ret);
d02b48c6 41int should_retry(int i);
edbb56ee 42void do_ssl_shutdown(SSL *ssl);
d02b48c6 43
0800318a
TM
44long bio_dump_callback(BIO *bio, int cmd, const char *argp, size_t len,
45 int argi, long argl, int ret, size_t *processed);
d02b48c6 46
6d23cf97 47void apps_ssl_info_callback(const SSL *s, int where, int ret);
0f113f3e
MC
48void msg_cb(int write_p, int version, int content_type, const void *buf,
49 size_t len, SSL *ssl, void *arg);
b6981744 50void tlsext_cb(SSL *s, int client_server, int type, const unsigned char *data,
0f113f3e 51 int len, void *arg);
07a9d1a2 52
0f113f3e
MC
53int generate_cookie_callback(SSL *ssl, unsigned char *cookie,
54 unsigned int *cookie_len);
31011544 55int verify_cookie_callback(SSL *ssl, const unsigned char *cookie,
0f113f3e 56 unsigned int cookie_len);
18d71588 57
ca1ed290
RL
58#ifdef __VMS /* 31 char symbol name limit */
59# define generate_stateless_cookie_callback generate_stateless_cookie_cb
60# define verify_stateless_cookie_callback verify_stateless_cookie_cb
61#endif
62
3fa2812f
BS
63int generate_stateless_cookie_callback(SSL *ssl, unsigned char *cookie,
64 size_t *cookie_len);
65int verify_stateless_cookie_callback(SSL *ssl, const unsigned char *cookie,
66 size_t cookie_len);
67
18d71588
DSH
68typedef struct ssl_excert_st SSL_EXCERT;
69
70void ssl_ctx_set_excert(SSL_CTX *ctx, SSL_EXCERT *exc);
71void ssl_excert_free(SSL_EXCERT *exc);
7e1b7485
RS
72int args_excert(int option, SSL_EXCERT **pexc);
73int load_excert(SSL_EXCERT **pexc);
c0a445a9 74void print_verify_detail(SSL *s, BIO *bio);
ecf3a1fb 75void print_ssl_summary(SSL *s);
dba31777 76int config_ctx(SSL_CONF_CTX *cctx, STACK_OF(OPENSSL_STRING) *str, SSL_CTX *ctx);
0f113f3e
MC
77int ssl_ctx_add_crls(SSL_CTX *ctx, STACK_OF(X509_CRL) *crls,
78 int crl_download);
79int ssl_load_stores(SSL_CTX *ctx, const char *vfyCApath,
fd3397fc
RL
80 const char *vfyCAfile, const char *vfyCAstore,
81 const char *chCApath, const char *chCAfile,
82 const char *chCAstore, STACK_OF(X509_CRL) *crls,
0f113f3e 83 int crl_download);
ecf3a1fb 84void ssl_ctx_security_debug(SSL_CTX *ctx, int verbose);
4bf73e9f 85int set_keylog_file(SSL_CTX *ctx, const char *keylog_file);
5969a2dd 86void print_ca_names(BIO *bio, SSL *s);
af5e63e1 87void ssl_print_secure_renegotiation_notes(BIO *bio, SSL *s);
6d2a1eff
MC
88
89#ifndef OPENSSL_NO_SRP
90/* The client side SRP context that we pass to all SRP related callbacks */
91typedef struct srp_arg_st {
92 char *srppassin;
93 char *srplogin;
94 int msg; /* copy from c_msg */
95 int debug; /* copy from c_debug */
96 int amp; /* allow more groups */
97 int strength; /* minimal size for N */
98} SRP_ARG;
99
100int set_up_srp_arg(SSL_CTX *ctx, SRP_ARG *srp_arg, int srp_lateuser, int c_msg,
101 int c_debug);
76cb077f 102void set_up_dummy_srp(SSL_CTX *ctx);
6d2a1eff
MC
103
104/* The server side SRP context that we pass to all SRP related callbacks */
105typedef struct srpsrvparm_st {
106 char *login;
107 SRP_VBASE *vb;
108 SRP_user_pwd *user;
109} srpsrvparm;
110
111int set_up_srp_verifier_file(SSL_CTX *ctx, srpsrvparm *srp_callback_parm,
112 char *srpuserseed, char *srp_verifier_file);
113void lookup_srp_user(srpsrvparm *srp_callback_parm, BIO *bio_s_out);
114#endif /* OPENSSL_NO_SRP */