-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added option to verify server's cert fingerprint #71
added option to verify server's cert fingerprint #71
Conversation
crypto.c
Outdated
fingerprint_len); | ||
return 1; | ||
} | ||
for(unsigned int i=0; i<SHA256_DIGEST_LENGTH; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memcmp?
crypto.c
Outdated
if(!X509_digest(cert, EVP_sha256(), fingerprint, &fingerprint_len)) { | ||
syslog(LOG_WARNING, "failed to load fingerprint of server's certicate: %s", | ||
ssl_errstr()); | ||
return 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (1);
dma.8
Outdated
@@ -226,6 +226,8 @@ Uncomment if you want TLS/SSL secured transfer. | |||
Uncomment if you want to use STARTTLS. | |||
Only useful together with | |||
.Sq SECURETRANS . | |||
.It Ic FINGERPRINT Xo | |||
Optionally verify SHA256 fingerprint of smarthost's certificate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about: "Pin the server certificate by specifying its SHA256 fingerprint. Only makes sense if you use a smarthost."
dma.conf
Outdated
@@ -25,6 +25,9 @@ | |||
# SECURETRANSFER) | |||
#STARTTLS | |||
|
|||
# Optionally verify SHA256 fingerprint of smarthost's certificate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(copy doc here)
crypto.c
Outdated
@@ -78,6 +78,30 @@ init_cert_file(SSL_CTX *ctx, const char *path) | |||
return (0); | |||
} | |||
|
|||
unsigned int verify_server_fingerprint(const X509 *cert) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int
verify_server_fingerprint(...)
conf.c
Outdated
if (fingerprint == NULL) { | ||
errlogx(EX_CONFIG, "fingerprint allocation failed"); | ||
} | ||
for (unsigned int i=0; i<SHA256_DIGEST_LENGTH; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces around =
and <
8f1204a
to
2865b20
Compare
Thanks for the quick response and review I applied your suggestions |
#10