aboutsummaryrefslogtreecommitdiffstats
path: root/imap-send.c
diff options
context:
space:
mode:
Diffstat (limited to 'imap-send.c')
-rw-r--r--imap-send.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/imap-send.c b/imap-send.c
index 68ab1aea83..27dc033c7f 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -324,6 +324,8 @@ static int ssl_socket_connect(struct imap_socket *sock,
cert = SSL_get_peer_certificate(sock->ssl);
if (!cert)
return error("unable to get peer certificate.");
+ if (SSL_get_verify_result(sock->ssl) != X509_V_OK)
+ return error("unable to verify peer certificate");
if (verify_hostname(cert, cfg->host) < 0)
return -1;
}
@@ -922,7 +924,7 @@ static void server_fill_credential(struct imap_server_conf *srvc, struct credent
cred->username = xstrdup_or_null(srvc->user);
cred->password = xstrdup_or_null(srvc->pass);
- credential_fill(cred, 1);
+ credential_fill(the_repository, cred, 1);
if (!srvc->user)
srvc->user = xstrdup(cred->username);
@@ -1123,7 +1125,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
} /* !preauth */
if (cred.username)
- credential_approve(&cred);
+ credential_approve(the_repository, &cred);
credential_clear(&cred);
/* check the target mailbox exists */
@@ -1150,7 +1152,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c
bail:
if (cred.username)
- credential_reject(&cred);
+ credential_reject(the_repository, &cred);
credential_clear(&cred);
out:
@@ -1492,9 +1494,9 @@ static int curl_append_msgs_to_imap(struct imap_server_conf *server,
if (cred.username) {
if (res == CURLE_OK)
- credential_approve(&cred);
+ credential_approve(the_repository, &cred);
else if (res == CURLE_LOGIN_DENIED)
- credential_reject(&cred);
+ credential_reject(the_repository, &cred);
}
credential_clear(&cred);