Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: nss/lib/pk11wrap/pk11mech.c

Issue 27510015: Support ChaCha20+Poly1305 cipher suites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Fix compilation error, fix typos in function arguments Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 /* 4 /*
5 * This file maps various PKCS #11 Mechanisms to related mechanisms, key 5 * This file maps various PKCS #11 Mechanisms to related mechanisms, key
6 * types, and ASN.1 encodings. 6 * types, and ASN.1 encodings.
7 */ 7 */
8 #include "seccomon.h" 8 #include "seccomon.h"
9 #include "secmod.h" 9 #include "secmod.h"
10 #include "secmodi.h" 10 #include "secmodi.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 case CKM_SHA384_HMAC_GENERAL: 389 case CKM_SHA384_HMAC_GENERAL:
390 case CKM_SHA512_HMAC: 390 case CKM_SHA512_HMAC:
391 case CKM_SHA512_HMAC_GENERAL: 391 case CKM_SHA512_HMAC_GENERAL:
392 case CKM_MD2_HMAC: 392 case CKM_MD2_HMAC:
393 case CKM_MD2_HMAC_GENERAL: 393 case CKM_MD2_HMAC_GENERAL:
394 case CKM_MD5_HMAC: 394 case CKM_MD5_HMAC:
395 case CKM_MD5_HMAC_GENERAL: 395 case CKM_MD5_HMAC_GENERAL:
396 case CKM_TLS_PRF_GENERAL: 396 case CKM_TLS_PRF_GENERAL:
397 case CKM_NSS_TLS_PRF_GENERAL_SHA256: 397 case CKM_NSS_TLS_PRF_GENERAL_SHA256:
398 return CKK_GENERIC_SECRET; 398 return CKK_GENERIC_SECRET;
399 case CKM_NSS_CHACHA20_POLY1305:
400 return CKK_NSS_CHACHA20;
399 default: 401 default:
400 return pk11_lookup(type)->keyType; 402 return pk11_lookup(type)->keyType;
401 } 403 }
402 } 404 }
403 405
404 /* 406 /*
405 * Get the Key Gen Mechanism needed for the given 407 * Get the Key Gen Mechanism needed for the given
406 * crypto mechanism 408 * crypto mechanism
407 */ 409 */
408 CK_MECHANISM_TYPE 410 CK_MECHANISM_TYPE
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 case CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC: 608 case CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC:
607 case CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC: 609 case CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC:
608 case CKM_PBE_SHA1_RC2_40_CBC: 610 case CKM_PBE_SHA1_RC2_40_CBC:
609 case CKM_PBE_SHA1_RC2_128_CBC: 611 case CKM_PBE_SHA1_RC2_128_CBC:
610 case CKM_PBE_SHA1_RC4_40: 612 case CKM_PBE_SHA1_RC4_40:
611 case CKM_PBE_SHA1_RC4_128: 613 case CKM_PBE_SHA1_RC4_128:
612 case CKM_PBE_SHA1_DES3_EDE_CBC: 614 case CKM_PBE_SHA1_DES3_EDE_CBC:
613 case CKM_PBE_SHA1_DES2_EDE_CBC: 615 case CKM_PBE_SHA1_DES2_EDE_CBC:
614 case CKM_PKCS5_PBKD2: 616 case CKM_PKCS5_PBKD2:
615 return type; 617 return type;
618 case CKM_NSS_CHACHA20_POLY1305:
619 return CKM_NSS_CHACHA20_KEY_GEN;
616 default: 620 default:
617 return pk11_lookup(type)->keyGen; 621 return pk11_lookup(type)->keyGen;
618 } 622 }
619 } 623 }
620 624
621 /* 625 /*
622 * get the mechanism block size 626 * get the mechanism block size
623 */ 627 */
624 int 628 int
625 PK11_GetBlockSize(CK_MECHANISM_TYPE type,SECItem *params) 629 PK11_GetBlockSize(CK_MECHANISM_TYPE type,SECItem *params)
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 case SEC_OID_MISSI_DSS: 1881 case SEC_OID_MISSI_DSS:
1878 case SEC_OID_MISSI_DSS_OLD: 1882 case SEC_OID_MISSI_DSS_OLD:
1879 case SEC_OID_MISSI_KEA_DSS_OLD: 1883 case SEC_OID_MISSI_KEA_DSS_OLD:
1880 case SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST: 1884 case SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST:
1881 return SEC_OID_ANSIX9_DSA_SIGNATURE; 1885 return SEC_OID_ANSIX9_DSA_SIGNATURE;
1882 default: 1886 default:
1883 break; 1887 break;
1884 } 1888 }
1885 return algTag; 1889 return algTag;
1886 } 1890 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698