Bug 1526302 - remove MD2 support from nsICryptoHash, clarifiy hash IDs must be synchronized with NSS hasht.h r=keeler

Differential Revision: https://phabricator.services.mozilla.com/D19150

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kai Engert 2019-03-02 15:37:30 +00:00
Родитель c44f408a52
Коммит e576732f18
3 изменённых файлов: 4 добавлений и 20 удалений

Просмотреть файл

@ -38,9 +38,6 @@ NS_IMETHODIMP
nsCryptoHash::Init(uint32_t algorithm) {
HASH_HashType hashType;
switch (algorithm) {
case nsICryptoHash::MD2:
hashType = HASH_AlgMD2;
break;
case nsICryptoHash::MD5:
hashType = HASH_AlgMD5;
break;
@ -85,8 +82,6 @@ nsCryptoHash::Init(uint32_t algorithm) {
NS_IMETHODIMP
nsCryptoHash::InitWithString(const nsACString &aAlgorithm) {
if (aAlgorithm.LowerCaseEqualsLiteral("md2")) return Init(nsICryptoHash::MD2);
if (aAlgorithm.LowerCaseEqualsLiteral("md5")) return Init(nsICryptoHash::MD5);
if (aAlgorithm.LowerCaseEqualsLiteral("sha1"))

Просмотреть файл

@ -16,10 +16,11 @@ interface nsICryptoHash : nsISupports
/**
* Hashing Algorithms. These values are to be used by the
* |init| method to indicate which hashing function to
* use. These values map directly onto the values defined
* in mozilla/security/nss/lib/cryptohi/hasht.h.
* use. These values must be identical to the values defined
* in security/nss/lib/util/hasht.h in type HASH_HashType.
* This allows us to use NSS mapping functions like
* HASH_GetHashOidTagByHashType with these values.
*/
const short MD2 = 1; /* String value: "md2" */
const short MD5 = 2; /* String value: "md5" */
const short SHA1 = 3; /* String value: "sha1" */
const short SHA256 = 4; /* String value: "sha256" */

Просмотреть файл

@ -8,18 +8,6 @@ const messages = [
"",
];
const ALGORITHMS = [
{
initString: "md2",
initConstant: Ci.nsICryptoHash.MD2,
hexHashes: [
"03d85a0d629d2c442e987525319fc471",
"8350e5a3e24c153df2275c9f80692773",
],
b64Hashes: [
"A9haDWKdLEQumHUlMZ/EcQ==",
"g1Dlo+JMFT3yJ1yfgGkncw==",
],
},
{
initString: "md5",
initConstant: Ci.nsICryptoHash.MD5,