Skip to content
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

Merged
merged 2 commits into from
Dec 29, 2019

Conversation

fphammerle
Copy link
Contributor

#10

crypto.c Outdated
fingerprint_len);
return 1;
}
for(unsigned int i=0; i<SHA256_DIGEST_LENGTH; i++) {
Copy link
Owner

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;
Copy link
Owner

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.
Copy link
Owner

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.
Copy link
Owner

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)
Copy link
Owner

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++) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces around = and <

fphammerle added a commit to fphammerle/dma that referenced this pull request Dec 29, 2019
@fphammerle
Copy link
Contributor Author

Thanks for the quick response and review

I applied your suggestions

@corecode corecode merged commit b858409 into corecode:master Dec 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants