Home | History | Annotate | Download | only in dist

Lines Matching defs:ssl

76 		snprintf(errbuf, errbuflen, "Cannot get a new SSL context: %s", ERR_error_string(ERR_get_error(), NULL));
134 SSL *ssl_promotion(int is_server, PCAP_SOCKET s, char *errbuf, size_t errbuflen)
140 SSL *ssl = SSL_new(ctx); // TODO: also a DTLS context
141 SSL_set_fd(ssl, (int)s);
144 if (SSL_accept(ssl) <= 0) {
150 if (SSL_connect(ssl) <= 0) {
157 return ssl;
160 // Finish using an SSL handle; shut down the connection and free the
162 void ssl_finish(SSL *ssl)
175 SSL_shutdown(ssl);
176 SSL_free(ssl);
181 int ssl_send(SSL *ssl, char const *buffer, int size, char *errbuf, size_t errbuflen)
183 int status = SSL_write(ssl, buffer, size);
191 int ssl_err = SSL_get_error(ssl, status); // TODO: does it pop the error?
208 // Returns the number of bytes read, or -1 on syserror, or -2 on SSL error.
209 int ssl_recv(SSL *ssl, char *buffer, int size, char *errbuf, size_t errbuflen)
211 int status = SSL_read(ssl, buffer, size);
214 int ssl_err = SSL_get_error(ssl, status);