From 6f105c41c202c570a37cc0cca2ab15172b2dbbaf Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Tue, 3 Dec 2019 09:41:58 +0000 Subject: Add certificate-missing error code Signed-off-by: Daniel Silverstone --- include/netsurf/ssl_certs.h | 1 + resources/FatMessages | 1 + utils/messages.c | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/include/netsurf/ssl_certs.h b/include/netsurf/ssl_certs.h index dcd644ea3..0444678a8 100644 --- a/include/netsurf/ssl_certs.h +++ b/include/netsurf/ssl_certs.h @@ -42,6 +42,7 @@ typedef enum { SSL_CERT_ERR_CHAIN_SELF_SIGNED, /**< This certificate chain is self signed */ SSL_CERT_ERR_REVOKED, /**< This certificate has been revoked */ SSL_CERT_ERR_HOSTNAME_MISMATCH, /**< This certificate host did not match the server */ + SSL_CERT_ERR_CERT_MISSING, /**< This certificate was missing from the chain, its data is useless */ } ssl_cert_err; /** Always the max known ssl certificate error type */ diff --git a/resources/FatMessages b/resources/FatMessages index f1cb87013..c5cfd3e21 100644 --- a/resources/FatMessages +++ b/resources/FatMessages @@ -1085,6 +1085,7 @@ en.all.SSLCertErrSelfSigned:The certificate is self signed. en.all.SSLCertErrChainSelfSigned:The certificate chain is self signed. en.all.SSLCertErrRevoked:The certificate has been revoked by the issuer. en.all.SSLCertErrHostnameMismatch:The certificate is for a different host than the server +en.all.SSLCertErrCertMissing:The certificate was missing from the chain. # Timeout error interface diff --git a/utils/messages.c b/utils/messages.c index 5525e18cc..418276ec3 100644 --- a/utils/messages.c +++ b/utils/messages.c @@ -445,6 +445,10 @@ const char *messages_get_sslcode(ssl_cert_err code) /* Common name is invalid */ return messages_get_ctx("SSLCertErrHostnameMismatch", messages_hash); + case SSL_CERT_ERR_CERT_MISSING: + /* Common name is invalid */ + return messages_get_ctx("SSLCertErrCertMissing", messages_hash); + } /* The switch has no default, so the compiler should tell us when we -- cgit v1.2.3