зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
c44f408a52
Коммит
e576732f18
|
@ -38,9 +38,6 @@ NS_IMETHODIMP
|
||||||
nsCryptoHash::Init(uint32_t algorithm) {
|
nsCryptoHash::Init(uint32_t algorithm) {
|
||||||
HASH_HashType hashType;
|
HASH_HashType hashType;
|
||||||
switch (algorithm) {
|
switch (algorithm) {
|
||||||
case nsICryptoHash::MD2:
|
|
||||||
hashType = HASH_AlgMD2;
|
|
||||||
break;
|
|
||||||
case nsICryptoHash::MD5:
|
case nsICryptoHash::MD5:
|
||||||
hashType = HASH_AlgMD5;
|
hashType = HASH_AlgMD5;
|
||||||
break;
|
break;
|
||||||
|
@ -85,8 +82,6 @@ nsCryptoHash::Init(uint32_t algorithm) {
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsCryptoHash::InitWithString(const nsACString &aAlgorithm) {
|
nsCryptoHash::InitWithString(const nsACString &aAlgorithm) {
|
||||||
if (aAlgorithm.LowerCaseEqualsLiteral("md2")) return Init(nsICryptoHash::MD2);
|
|
||||||
|
|
||||||
if (aAlgorithm.LowerCaseEqualsLiteral("md5")) return Init(nsICryptoHash::MD5);
|
if (aAlgorithm.LowerCaseEqualsLiteral("md5")) return Init(nsICryptoHash::MD5);
|
||||||
|
|
||||||
if (aAlgorithm.LowerCaseEqualsLiteral("sha1"))
|
if (aAlgorithm.LowerCaseEqualsLiteral("sha1"))
|
||||||
|
|
|
@ -16,10 +16,11 @@ interface nsICryptoHash : nsISupports
|
||||||
/**
|
/**
|
||||||
* Hashing Algorithms. These values are to be used by the
|
* Hashing Algorithms. These values are to be used by the
|
||||||
* |init| method to indicate which hashing function to
|
* |init| method to indicate which hashing function to
|
||||||
* use. These values map directly onto the values defined
|
* use. These values must be identical to the values defined
|
||||||
* in mozilla/security/nss/lib/cryptohi/hasht.h.
|
* 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 MD5 = 2; /* String value: "md5" */
|
||||||
const short SHA1 = 3; /* String value: "sha1" */
|
const short SHA1 = 3; /* String value: "sha1" */
|
||||||
const short SHA256 = 4; /* String value: "sha256" */
|
const short SHA256 = 4; /* String value: "sha256" */
|
||||||
|
|
|
@ -8,18 +8,6 @@ const messages = [
|
||||||
"",
|
"",
|
||||||
];
|
];
|
||||||
const ALGORITHMS = [
|
const ALGORITHMS = [
|
||||||
{
|
|
||||||
initString: "md2",
|
|
||||||
initConstant: Ci.nsICryptoHash.MD2,
|
|
||||||
hexHashes: [
|
|
||||||
"03d85a0d629d2c442e987525319fc471",
|
|
||||||
"8350e5a3e24c153df2275c9f80692773",
|
|
||||||
],
|
|
||||||
b64Hashes: [
|
|
||||||
"A9haDWKdLEQumHUlMZ/EcQ==",
|
|
||||||
"g1Dlo+JMFT3yJ1yfgGkncw==",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
initString: "md5",
|
initString: "md5",
|
||||||
initConstant: Ci.nsICryptoHash.MD5,
|
initConstant: Ci.nsICryptoHash.MD5,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче