From 98f4b199aebaa21564c1ab9c9de019bdec627824 Mon Sep 17 00:00:00 2001 From: Franziskus Kiefer Date: Thu, 29 Mar 2018 11:51:33 +0200 Subject: Bug 1448787 - separate error for self-signed certs, r=keeler,johannh Reviewed By: keeler, johannh Bug #: 1448787 Differential Revision: https://phabricator.services.mozilla.com/D805 --- lib/mozpkix/include/pkix/Result.h | 2 ++ lib/mozpkix/include/pkix/pkixnss.h | 1 + lib/mozpkix/lib/pkixnss.cpp | 2 ++ 3 files changed, 5 insertions(+) (limited to 'lib/mozpkix') diff --git a/lib/mozpkix/include/pkix/Result.h b/lib/mozpkix/include/pkix/Result.h index 831d3414c..3cd52559f 100644 --- a/lib/mozpkix/include/pkix/Result.h +++ b/lib/mozpkix/include/pkix/Result.h @@ -193,6 +193,8 @@ static const unsigned int FATAL_ERROR_FLAG = 0x800; MOZILLA_PKIX_ERROR_EMPTY_ISSUER_NAME) \ MOZILLA_PKIX_MAP(ERROR_ADDITIONAL_POLICY_CONSTRAINT_FAILED, 54, \ MOZILLA_PKIX_ERROR_ADDITIONAL_POLICY_CONSTRAINT_FAILED) \ + MOZILLA_PKIX_MAP(ERROR_SELF_SIGNED_CERT, 55, \ + MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT) \ MOZILLA_PKIX_MAP(FATAL_ERROR_INVALID_ARGS, FATAL_ERROR_FLAG | 1, \ SEC_ERROR_INVALID_ARGS) \ MOZILLA_PKIX_MAP(FATAL_ERROR_INVALID_STATE, FATAL_ERROR_FLAG | 2, \ diff --git a/lib/mozpkix/include/pkix/pkixnss.h b/lib/mozpkix/include/pkix/pkixnss.h index c79a128fa..b999426c4 100644 --- a/lib/mozpkix/include/pkix/pkixnss.h +++ b/lib/mozpkix/include/pkix/pkixnss.h @@ -88,6 +88,7 @@ enum ErrorCode MOZILLA_PKIX_ERROR_INVALID_INTEGER_ENCODING = ERROR_BASE + 11, MOZILLA_PKIX_ERROR_EMPTY_ISSUER_NAME = ERROR_BASE + 12, MOZILLA_PKIX_ERROR_ADDITIONAL_POLICY_CONSTRAINT_FAILED = ERROR_BASE + 13, + MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT = ERROR_BASE + 14, END_OF_LIST }; diff --git a/lib/mozpkix/lib/pkixnss.cpp b/lib/mozpkix/lib/pkixnss.cpp index 3b9517fd9..24b11ce9a 100644 --- a/lib/mozpkix/lib/pkixnss.cpp +++ b/lib/mozpkix/lib/pkixnss.cpp @@ -214,6 +214,8 @@ RegisterErrorTable() { "MOZILLA_PKIX_ERROR_ADDITIONAL_POLICY_CONSTRAINT_FAILED", "An additional policy constraint failed when validating this " "certificate." }, + { "MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT", + "The certificate is not trusted because it is self-signed." }, }; // Note that these error strings are not localizable. // When these strings change, update the localization information too. -- cgit v1.2.1