summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranziskus Kiefer <franziskuskiefer@gmail.com>2018-03-29 11:51:33 +0200
committerFranziskus Kiefer <franziskuskiefer@gmail.com>2018-03-29 11:51:33 +0200
commit98f4b199aebaa21564c1ab9c9de019bdec627824 (patch)
treea11ba57ffada8d264528f4c6944d1f8414dda6ab
parented3dce7440c15022e8f6a8848fb6667537e79b72 (diff)
downloadnss-hg-98f4b199aebaa21564c1ab9c9de019bdec627824.tar.gz
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
-rw-r--r--lib/mozpkix/include/pkix/Result.h2
-rw-r--r--lib/mozpkix/include/pkix/pkixnss.h1
-rw-r--r--lib/mozpkix/lib/pkixnss.cpp2
3 files changed, 5 insertions, 0 deletions
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.