summaryrefslogtreecommitdiffstats
path: root/conn/ssl.h
blob: d3c8fc82d06b473975ac88292acabf28ba693781 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
 * @file
 * Handling of SSL encryption
 *
 * @authors
 * Copyright (C) 1999-2000 Tommi Komulainen <Tommi.Komulainen@iki.fi>
 *
 * @copyright
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 2 of the License, or (at your option) any later
 * version.
 *
 * 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/>.
 */

#ifndef MUTT_CONN_SSL_H
#define MUTT_CONN_SSL_H

#include "config.h"
#include <stdbool.h>
#include "mutt/lib.h"

struct Connection;

#ifdef USE_SSL
/// Array of text making up a Certificate
ARRAY_HEAD(CertArray, const char *);

void cert_array_clear(struct CertArray *carr);

/**
 * struct CertMenuData - Certificate data to use in the Menu
 */
struct CertMenuData
{
  struct CertArray *carr;      ///< Lines of the Certificate
  char *prompt;                ///< Prompt for user, similar to mw_multi_choice
  char *keys;                  ///< Keys used in the prompt
};

int mutt_ssl_socket_setup(struct Connection *conn);
int dlg_certificate(const char *title, struct CertArray *carr, bool allow_always, bool allow_skip);
#else
/**
 * [Dummy] Set up the socket multiplexor
 * @retval -1 Failure
 */
static inline int mutt_ssl_socket_setup(struct Connection *conn)
{
  return -1;
}
#endif

#endif /* MUTT_CONN_SSL_H */