33 #include <sys/select.h> 34 #include <sys/socket.h> 35 #include <sys/types.h> 37 #include "../src/smtp.h" 40 # include <openssl/bio.h> 41 # include <openssl/err.h> 42 # include <openssl/ssl.h> 43 # include <openssl/x509.h> 44 # include <openssl/x509v3.h> 53 size_t *
const result);
58 size_t *
const result);
63 size_t *
const result);
67 unsigned char **decode);
79 const char *
const buf,
106 const char *
const replace,
107 const char *
const s);
121 unsigned int maxlen);
125 unsigned int maxlen);
130 const char *
const end);
182 const struct sockaddr *address,
183 socklen_t address_len);
202 const unsigned char *d,
205 unsigned int *md_len);
233 struct timeval *timeout);
280 const char *format, ...);
int g_smtp_test_err_si_sub_size_t_ctr
int smtp_test_seam_dec_err_ctr(int *const test_err_ctr)
int g_smtp_test_err_recv_ctr
int g_smtp_test_err_sprintf_ctr
long smtp_test_seam_recv(int socket, void *buffer, size_t length, int flags)
int smtp_test_seam_ssl_do_handshake(SSL *ssl)
int smtp_date_rfc_2822(char *const date)
int smtp_parse_cmd_line(char *const line, struct smtp_command *const cmd)
char * smtp_fold_whitespace(const char *const s, unsigned int maxlen)
int g_smtp_test_err_ssl_do_handshake_ctr
int smtp_address_validate_name(const char *const name)
int g_smtp_test_err_gmtime_r_ctr
int g_smtp_test_err_malloc_ctr
int g_smtp_test_err_bio_should_retry_rc
char * smtp_stpcpy(char *s1, const char *s2)
int g_smtp_test_err_close_ctr
int smtp_str_getdelimfd(struct str_getdelimfd *const gdfd)
size_t smtp_strnlen_utf8(const char *s, size_t maxlen)
int smtp_test_seam_ssl_connect(SSL *ssl)
ssize_t smtp_test_seam_send(int socket, const void *buffer, size_t length, int flags)
struct tm * smtp_test_seam_localtime_r(const time_t *timep, struct tm *result)
int g_smtp_test_err_calloc_ctr
enum smtp_status_code smtp_write(struct smtp *const smtp, const char *const buf, size_t len)
int g_smtp_test_err_err_peek_error_ctr
int smtp_header_key_validate(const char *const key)
int smtp_test_seam_ssl_read(SSL *ssl, void *buf, int num)
int smtp_str_getdelimfd_set_line_and_buf(struct str_getdelimfd *const gdfd, size_t copy_len)
int g_smtp_test_err_connect_ctr
int smtp_test_seam_sprintf(char *s, const char *format,...)
int g_smtp_test_err_localtime_r_ctr
int smtp_test_seam_x509_check_host(X509 *cert, const char *name, size_t namelen, unsigned int flags, char **peername)
int g_smtp_test_err_ssl_read_ctr
void * smtp_reallocarray(void *ptr, size_t nmemb, size_t size)
int smtp_test_seam_fclose(FILE *stream)
X509 * smtp_test_seam_ssl_get_peer_certificate(const SSL *ssl)
int smtp_test_seam_bio_should_retry(BIO *bio)
char * smtp_bin2hex(const unsigned char *const s, size_t slen)
int g_smtp_test_err_ssl_new_ctr
size_t smtp_fold_whitespace_get_offset(const char *const s, unsigned int maxlen)
SSL * smtp_test_seam_ssl_new(SSL_CTX *ctx)
time_t g_smtp_test_time_ret_value
int g_smtp_test_err_bio_new_socket_ctr
size_t smtp_utf8_charlen(char c)
int g_smtp_test_err_send_ctr
int smtp_test_seam_ferror(FILE *stream)
BIO * smtp_test_seam_bio_new_socket(int sock, int close_flag)
time_t smtp_test_seam_time(time_t *tloc)
int g_smtp_test_err_recv_rc
int smtp_test_seam_close(int fildes)
void smtp_str_getdelimfd_free(struct str_getdelimfd *const gdfd)
size_t g_smtp_test_strlen_ret_value
int g_smtp_test_err_bio_should_retry_ctr
int smtp_test_seam_ssl_write(SSL *ssl, const void *buf, int num)
int smtp_attachment_validate_name(const char *const name)
int g_smtp_test_err_si_mul_size_t_ctr
int smtp_si_mul_size_t(const size_t a, const size_t b, size_t *const result)
int smtp_test_seam_connect(int socket, const struct sockaddr *address, socklen_t address_len)
int g_smtp_test_err_si_add_size_t_ctr
int g_smtp_test_err_realloc_ctr
char * smtp_base64_encode(const char *const buf, size_t buflen)
int smtp_address_validate_email(const char *const email)
SSL_CTX * smtp_test_seam_ssl_ctx_new(const SSL_METHOD *method)
int g_smtp_test_err_mktime_ctr
int g_smtp_test_send_one_byte
int g_smtp_test_err_hmac_ctr
int g_smtp_test_err_ferror_ctr
int g_smtp_test_err_fclose_ctr
int g_smtp_test_err_ssl_get_peer_certificate_ctr
char * smtp_chunk_split(const char *const s, size_t chunklen, const char *const end)
int g_smtp_test_strlen_custom_ret
int smtp_test_seam_socket(int domain, int type, int protocol)
size_t smtp_base64_decode(const char *const buf, unsigned char **decode)
void * smtp_test_seam_malloc(size_t size)
int smtp_test_seam_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout)
struct tm * smtp_test_seam_gmtime_r(const time_t *timep, struct tm *result)
char * smtp_file_get_contents(const char *const filename, size_t *bytes_read)
unsigned long smtp_test_seam_err_peek_error(void)
unsigned char * smtp_test_seam_hmac(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, size_t n, unsigned char *md, unsigned int *md_len)
int smtp_si_add_size_t(const size_t a, const size_t b, size_t *const result)
char * smtp_ffile_get_contents(FILE *stream, size_t *bytes_read)
int smtp_header_value_validate(const char *const value)
int smtp_si_sub_size_t(const size_t a, const size_t b, size_t *const result)
int g_smtp_test_err_ssl_connect_ctr
time_t smtp_test_seam_mktime(struct tm *timeptr)
int g_smtp_test_err_socket_ctr
int g_smtp_test_err_ssl_ctx_new_ctr
size_t smtp_test_seam_strlen(const char *s)
char g_smtp_test_err_recv_bytes[90]
void * smtp_test_seam_realloc(void *ptr, size_t size)
void * smtp_test_seam_calloc(size_t nelem, size_t elsize)
int g_smtp_test_err_ssl_write_ctr
int g_smtp_test_err_x509_check_host_ctr
int g_smtp_test_time_custom_ret
int smtp_str_has_nonascii_utf8(const char *const s)
int g_smtp_test_err_select_ctr
char * smtp_str_replace(const char *const search, const char *const replace, const char *const s)
int g_smtp_test_err_sprintf_rc
char * smtp_strdup(const char *s)