NeoMutt  2024-04-16-36-g75b6fb
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
ssl.h File Reference

Handling of SSL encryption. More...

#include "config.h"
#include <stdbool.h>
#include "mutt/lib.h"
+ Include dependency graph for ssl.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CertMenuData
 Certificate data to use in the Menu. More...
 

Functions

 ARRAY_HEAD (CertArray, const char *)
 Array of text making up a Certificate.
 
void cert_array_clear (struct CertArray *carr)
 Free all memory of a CertArray.
 
int mutt_ssl_socket_setup (struct Connection *conn)
 Set up SSL socket mulitplexor.
 
int dlg_certificate (const char *title, struct CertArray *carr, bool allow_always, bool allow_skip)
 Ask the user to validate the certificate -.
 

Detailed Description

Handling of SSL encryption.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file ssl.h.

Function Documentation

◆ ARRAY_HEAD()

ARRAY_HEAD ( CertArray  ,
const char *   
)

Array of text making up a Certificate.

◆ cert_array_clear()

void cert_array_clear ( struct CertArray *  carr)

Free all memory of a CertArray.

Parameters
carrArray of text to clear
Note
Array is emptied, but not freed

Definition at line 157 of file dlg_verifycert.c.

158{
159 const char **line = NULL;
160 ARRAY_FOREACH(line, carr)
161 {
162 FREE(line);
163 }
164}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:212
#define FREE(x)
Definition: memory.h:45
+ Here is the caller graph for this function:

◆ mutt_ssl_socket_setup()

int mutt_ssl_socket_setup ( struct Connection conn)

Set up SSL socket mulitplexor.

Parameters
connConnection to a server
Return values
0Success
-1Error

Definition at line 1129 of file gnutls.c.

1130{
1131 if (tls_init() < 0)
1132 return -1;
1133
1134 conn->open = tls_socket_open;
1135 conn->read = tls_socket_read;
1136 conn->write = tls_socket_write;
1137 conn->close = tls_socket_close;
1138 conn->poll = tls_socket_poll;
1139
1140 return 0;
1141}
static int tls_init(void)
Set up Gnu TLS.
Definition: gnutls.c:92
static int tls_socket_close(struct Connection *conn)
Close a TLS socket - Implements Connection::close() -.
Definition: gnutls.c:1007
static int tls_socket_open(struct Connection *conn)
Open a TLS socket - Implements Connection::open() -.
Definition: gnutls.c:1032
static int tls_socket_poll(struct Connection *conn, time_t wait_secs)
Check if any data is waiting on a socket - Implements Connection::poll() -.
Definition: gnutls.c:992
static int tls_socket_read(struct Connection *conn, char *buf, size_t count)
Read data from a TLS socket - Implements Connection::read() -.
Definition: gnutls.c:1049
static int tls_socket_write(struct Connection *conn, const char *buf, size_t count)
Write data to a TLS socket - Implements Connection::write() -.
Definition: gnutls.c:1076
int(* poll)(struct Connection *conn, time_t wait_secs)
Definition: connection.h:105
int(* write)(struct Connection *conn, const char *buf, size_t count)
Definition: connection.h:92
int(* close)(struct Connection *conn)
Definition: connection.h:116
int(* open)(struct Connection *conn)
Definition: connection.h:66
int(* read)(struct Connection *conn, char *buf, size_t count)
Definition: connection.h:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function: