Home | History | Annotate | Download | only in ssl

Lines Matching refs:ssl

15 #include <openssl/ssl.h>
52 static int default_add_callback(SSL *ssl, unsigned extension_value,
55 if (ssl->server) {
62 static int custom_ext_add_hello(SSL *ssl, CBB *extensions) {
63 STACK_OF(SSL_CUSTOM_EXTENSION) *stack = ssl->ctx->client_custom_extensions;
64 if (ssl->server) {
65 stack = ssl->ctx->server_custom_extensions;
76 if (ssl->server &&
77 !(ssl->s3->tmp.custom_extensions.received & (1u << i))) {
87 switch (ext->add_callback(ssl, ext->value, &contents, &contents_len, &alert,
94 OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR);
97 ext->free_callback(ssl, ext->value, contents, ext->add_arg);
103 ext->free_callback(ssl, ext->value, contents, ext->add_arg);
106 if (!ssl->server) {
107 assert((ssl->s3->tmp.custom_extensions.sent & (1u << i)) == 0);
108 ssl->s3->tmp.custom_extensions.sent |= (1u << i);
116 ssl3_send_alert(ssl, SSL3_AL_FATAL, alert);
117 OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR);
126 int custom_ext_add_clienthello(SSL *ssl, CBB *extensions) {
127 return custom_ext_add_hello(ssl, extensions);
130 int custom_ext_parse_serverhello(SSL *ssl, int *out_alert, uint16_t value,
134 custom_ext_find(ssl->ctx->client_custom_extensions, &index, value);
139 !(ssl->s3->tmp.custom_extensions.sent & (1u << index))) {
140 OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION);
147 !ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension),
149 OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR);
157 int custom_ext_parse_clienthello(SSL *ssl, int *out_alert, uint16_t value,
161 custom_ext_find(ssl->ctx->server_custom_extensions, &index, value);
167 assert((ssl->s3->tmp.custom_extensions.received & (1u << index)) == 0);
168 ssl->s3->tmp.custom_extensions.received |= (1u << index);
171 !ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension),
173 OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR);
181 int custom_ext_add_serverhello(SSL *ssl, CBB *extensions) {
182 return custom_ext_add_hello(ssl, extensions);