Qsmtp  0.30dev
Macros | Functions | Variables
starttls.c File Reference

functions for STARTTLS SMTP command More...

#include <qsmtpd/starttls.h>
#include <control.h>
#include <fmt.h>
#include <log.h>
#include <netio.h>
#include <qdns.h>
#include <qsmtpd/addrparse.h>
#include <qsmtpd/qsmtpd.h>
#include <qsmtpd/syntax.h>
#include <ssl_timeoutio.h>
#include <tls.h>
#include <version.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>

Macros

#define CLIENTCA   "control/clientca.pem"
 
#define CLIENTCRL   "control/clientcrl.pem"
 

Functions

static RSA * tmp_rsa_cb (SSL *s, int export, int keylen)
 
static DH * tmp_dh_cb (SSL *s, int export, int keylen)
 
static int tls_out (const char *s1, const char *s2)
 
static int tls_err (const char *s)
 
static int verify_callback (int preverify_ok, X509_STORE_CTX *x509_ctx)
 callback for SSL_set_verify() that accepts any certicate More...
 
int tls_verify (void)
 verify is authenticated to relay by SSL certificate More...
 
static int tls_init ()
 
int smtp_starttls (void)
 

Variables

static int ssl_verified
 

Detailed Description

functions for STARTTLS SMTP command

Function Documentation

int smtp_starttls ( void  )

initialize STARTTLS mode

Returns
0 on successful initialization, else error code
int tls_verify ( void  )

verify is authenticated to relay by SSL certificate

Return values
<1error code
0if client is not authenticated
>0if client is authenticated
static int verify_callback ( int  preverify_ok,
X509_STORE_CTX *  x509_ctx 
)
static

callback for SSL_set_verify() that accepts any certicate

Returns
1

This will accept any certificate chain, so the SSL session can be reestablished. The errors will be checked later by calling SSL_get_verify_result().