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

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

Issue 16132005: Allow NSS to be built with NO_NSPR_10_SUPPORT. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 6 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
« no previous file with comments | « nss/lib/pk11wrap/pk11pk12.c ('k') | nss/lib/pk11wrap/pk11slot.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /* Thse functions are stub functions which will get replaced with calls through 4 /* Thse functions are stub functions which will get replaced with calls through
5 * PKCS #11. 5 * PKCS #11.
6 */ 6 */
7 7
8 #include "pk11func.h" 8 #include "pk11func.h"
9 #include "secmod.h" 9 #include "secmod.h"
10 #include "secmodi.h" 10 #include "secmodi.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 }; 57 };
58 CK_ATTRIBUTE vTemplate[] = { 58 CK_ATTRIBUTE vTemplate[] = {
59 { CKA_NETSCAPE_PQG_COUNTER, NULL, 0 }, 59 { CKA_NETSCAPE_PQG_COUNTER, NULL, 0 },
60 { CKA_NETSCAPE_PQG_SEED, NULL, 0 }, 60 { CKA_NETSCAPE_PQG_SEED, NULL, 0 },
61 { CKA_NETSCAPE_PQG_H, NULL, 0 }, 61 { CKA_NETSCAPE_PQG_H, NULL, 0 },
62 }; 62 };
63 CK_ULONG primeBits = L; 63 CK_ULONG primeBits = L;
64 CK_ULONG subPrimeBits = N; 64 CK_ULONG subPrimeBits = N;
65 int pTemplateCount = sizeof(pTemplate)/sizeof(pTemplate[0]); 65 int pTemplateCount = sizeof(pTemplate)/sizeof(pTemplate[0]);
66 int vTemplateCount = sizeof(vTemplate)/sizeof(vTemplate[0]); 66 int vTemplateCount = sizeof(vTemplate)/sizeof(vTemplate[0]);
67 PRArenaPool *parena = NULL; 67 PLArenaPool *parena = NULL;
68 PRArenaPool *varena = NULL; 68 PLArenaPool *varena = NULL;
69 PQGParams *params = NULL; 69 PQGParams *params = NULL;
70 PQGVerify *verify = NULL; 70 PQGVerify *verify = NULL;
71 CK_ULONG seedBits = seedBytes*8; 71 CK_ULONG seedBits = seedBytes*8;
72 72
73 *pParams = NULL; 73 *pParams = NULL;
74 *pVfy = NULL; 74 *pVfy = NULL;
75 75
76 if (primeBits == (CK_ULONG)-1) { 76 if (primeBits == (CK_ULONG)-1) {
77 PORT_SetError(SEC_ERROR_INVALID_ARGS); 77 PORT_SetError(SEC_ERROR_INVALID_ARGS);
78 goto loser; 78 goto loser;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 #define PQG_DEFAULT_CHUNKSIZE 2048 /* bytes */ 372 #define PQG_DEFAULT_CHUNKSIZE 2048 /* bytes */
373 373
374 /************************************************************************** 374 /**************************************************************************
375 * Return a pointer to a new PQGParams struct that is constructed from * 375 * Return a pointer to a new PQGParams struct that is constructed from *
376 * copies of the arguments passed in. * 376 * copies of the arguments passed in. *
377 * Return NULL on failure. * 377 * Return NULL on failure. *
378 **************************************************************************/ 378 **************************************************************************/
379 extern PQGParams * 379 extern PQGParams *
380 PK11_PQG_NewParams(const SECItem * prime, const SECItem * subPrime, 380 PK11_PQG_NewParams(const SECItem * prime, const SECItem * subPrime,
381 const SECItem * base) { 381 const SECItem * base) {
382 PRArenaPool *arena; 382 PLArenaPool *arena;
383 PQGParams *dest; 383 PQGParams *dest;
384 SECStatus status; 384 SECStatus status;
385 385
386 arena = PORT_NewArena(PQG_DEFAULT_CHUNKSIZE); 386 arena = PORT_NewArena(PQG_DEFAULT_CHUNKSIZE);
387 if (arena == NULL) 387 if (arena == NULL)
388 goto loser; 388 goto loser;
389 389
390 dest = (PQGParams*)PORT_ArenaZAlloc(arena, sizeof(PQGParams)); 390 dest = (PQGParams*)PORT_ArenaZAlloc(arena, sizeof(PQGParams));
391 if (dest == NULL) 391 if (dest == NULL)
392 goto loser; 392 goto loser;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 445
446 446
447 /************************************************************************** 447 /**************************************************************************
448 * Return a pointer to a new PQGVerify struct that is constructed from * 448 * Return a pointer to a new PQGVerify struct that is constructed from *
449 * copies of the arguments passed in. * 449 * copies of the arguments passed in. *
450 * Return NULL on failure. * 450 * Return NULL on failure. *
451 **************************************************************************/ 451 **************************************************************************/
452 extern PQGVerify * 452 extern PQGVerify *
453 PK11_PQG_NewVerify(unsigned int counter, const SECItem * seed, 453 PK11_PQG_NewVerify(unsigned int counter, const SECItem * seed,
454 const SECItem * h) { 454 const SECItem * h) {
455 PRArenaPool *arena; 455 PLArenaPool *arena;
456 PQGVerify * dest; 456 PQGVerify * dest;
457 SECStatus status; 457 SECStatus status;
458 458
459 arena = PORT_NewArena(PQG_DEFAULT_CHUNKSIZE); 459 arena = PORT_NewArena(PQG_DEFAULT_CHUNKSIZE);
460 if (arena == NULL) 460 if (arena == NULL)
461 goto loser; 461 goto loser;
462 462
463 dest = (PQGVerify*)PORT_ArenaZAlloc(arena, sizeof(PQGVerify)); 463 dest = (PQGVerify*)PORT_ArenaZAlloc(arena, sizeof(PQGVerify));
464 if (dest == NULL) 464 if (dest == NULL)
465 goto loser; 465 goto loser;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 503
504 504
505 /************************************************************************** 505 /**************************************************************************
506 * Fills in caller's "h" SECItem with the h value in verify. 506 * Fills in caller's "h" SECItem with the h value in verify.
507 * Contents can be freed by calling SECITEM_FreeItem(h, PR_FALSE); 507 * Contents can be freed by calling SECITEM_FreeItem(h, PR_FALSE);
508 **************************************************************************/ 508 **************************************************************************/
509 extern SECStatus 509 extern SECStatus
510 PK11_PQG_GetHFromVerify(const PQGVerify *verify, SECItem * h) { 510 PK11_PQG_GetHFromVerify(const PQGVerify *verify, SECItem * h) {
511 return SECITEM_CopyItem(NULL, h, &verify->h); 511 return SECITEM_CopyItem(NULL, h, &verify->h);
512 } 512 }
OLDNEW
« no previous file with comments | « nss/lib/pk11wrap/pk11pk12.c ('k') | nss/lib/pk11wrap/pk11slot.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698