Mercurial > trustbridge > nss-cmake-static
comparison nss/lib/pki/cryptocontext.c @ 0:1e5118fa0cb1
This is NSS with a Cmake Buildsyste
To compile a static NSS library for Windows we've used the
Chromium-NSS fork and added a Cmake buildsystem to compile
it statically for Windows. See README.chromium for chromium
changes and README.trustbridge for our modifications.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 28 Jul 2014 10:47:06 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1e5118fa0cb1 |
---|---|
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 | |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
4 | |
5 #ifndef DEV_H | |
6 #include "dev.h" | |
7 #endif /* DEV_H */ | |
8 | |
9 #ifndef PKIM_H | |
10 #include "pkim.h" | |
11 #endif /* PKIM_H */ | |
12 | |
13 #ifndef PKISTORE_H | |
14 #include "pkistore.h" | |
15 #endif /* PKISTORE_H */ | |
16 | |
17 extern const NSSError NSS_ERROR_NOT_FOUND; | |
18 extern const NSSError NSS_ERROR_INVALID_ARGUMENT; | |
19 | |
20 NSS_IMPLEMENT NSSCryptoContext * | |
21 nssCryptoContext_Create ( | |
22 NSSTrustDomain *td, | |
23 NSSCallback *uhhOpt | |
24 ) | |
25 { | |
26 NSSArena *arena; | |
27 NSSCryptoContext *rvCC; | |
28 arena = NSSArena_Create(); | |
29 if (!arena) { | |
30 return NULL; | |
31 } | |
32 rvCC = nss_ZNEW(arena, NSSCryptoContext); | |
33 if (!rvCC) { | |
34 return NULL; | |
35 } | |
36 rvCC->td = td; | |
37 rvCC->arena = arena; | |
38 rvCC->certStore = nssCertificateStore_Create(rvCC->arena); | |
39 if (!rvCC->certStore) { | |
40 nssArena_Destroy(arena); | |
41 return NULL; | |
42 } | |
43 | |
44 return rvCC; | |
45 } | |
46 | |
47 NSS_IMPLEMENT PRStatus | |
48 NSSCryptoContext_Destroy ( | |
49 NSSCryptoContext *cc | |
50 ) | |
51 { | |
52 PRStatus status = PR_SUCCESS; | |
53 PORT_Assert(cc->certStore); | |
54 if (cc->certStore) { | |
55 status = nssCertificateStore_Destroy(cc->certStore); | |
56 if (status == PR_FAILURE) { | |
57 return status; | |
58 } | |
59 } else { | |
60 status = PR_FAILURE; | |
61 } | |
62 nssArena_Destroy(cc->arena); | |
63 return status; | |
64 } | |
65 | |
66 NSS_IMPLEMENT PRStatus | |
67 NSSCryptoContext_SetDefaultCallback ( | |
68 NSSCryptoContext *td, | |
69 NSSCallback *newCallback, | |
70 NSSCallback **oldCallbackOpt | |
71 ) | |
72 { | |
73 nss_SetError(NSS_ERROR_NOT_FOUND); | |
74 return PR_FAILURE; | |
75 } | |
76 | |
77 NSS_IMPLEMENT NSSCallback * | |
78 NSSCryptoContext_GetDefaultCallback ( | |
79 NSSCryptoContext *td, | |
80 PRStatus *statusOpt | |
81 ) | |
82 { | |
83 nss_SetError(NSS_ERROR_NOT_FOUND); | |
84 return NULL; | |
85 } | |
86 | |
87 NSS_IMPLEMENT NSSTrustDomain * | |
88 NSSCryptoContext_GetTrustDomain ( | |
89 NSSCryptoContext *td | |
90 ) | |
91 { | |
92 nss_SetError(NSS_ERROR_NOT_FOUND); | |
93 return NULL; | |
94 } | |
95 | |
96 | |
97 NSS_IMPLEMENT NSSCertificate * | |
98 NSSCryptoContext_FindOrImportCertificate ( | |
99 NSSCryptoContext *cc, | |
100 NSSCertificate *c | |
101 ) | |
102 { | |
103 NSSCertificate *rvCert = NULL; | |
104 | |
105 PORT_Assert(cc->certStore); | |
106 if (!cc->certStore) { | |
107 nss_SetError(NSS_ERROR_INVALID_ARGUMENT); | |
108 return rvCert; | |
109 } | |
110 rvCert = nssCertificateStore_FindOrAdd(cc->certStore, c); | |
111 if (rvCert == c && c->object.cryptoContext != cc) { | |
112 PORT_Assert(!c->object.cryptoContext); | |
113 c->object.cryptoContext = cc; | |
114 } | |
115 if (rvCert) { | |
116 /* an NSSCertificate cannot be part of two crypto contexts | |
117 ** simultaneously. If this assertion fails, then there is | |
118 ** a serious Stan design flaw. | |
119 */ | |
120 PORT_Assert(cc == c->object.cryptoContext); | |
121 } | |
122 return rvCert; | |
123 } | |
124 | |
125 NSS_IMPLEMENT NSSCertificate * | |
126 NSSCryptoContext_ImportPKIXCertificate ( | |
127 NSSCryptoContext *cc, | |
128 struct NSSPKIXCertificateStr *pc | |
129 ) | |
130 { | |
131 nss_SetError(NSS_ERROR_NOT_FOUND); | |
132 return NULL; | |
133 } | |
134 | |
135 NSS_IMPLEMENT NSSCertificate * | |
136 NSSCryptoContext_ImportEncodedCertificate ( | |
137 NSSCryptoContext *cc, | |
138 NSSBER *ber | |
139 ) | |
140 { | |
141 nss_SetError(NSS_ERROR_NOT_FOUND); | |
142 return NULL; | |
143 } | |
144 | |
145 NSS_IMPLEMENT PRStatus | |
146 NSSCryptoContext_ImportEncodedPKIXCertificateChain ( | |
147 NSSCryptoContext *cc, | |
148 NSSBER *ber | |
149 ) | |
150 { | |
151 nss_SetError(NSS_ERROR_NOT_FOUND); | |
152 return PR_FAILURE; | |
153 } | |
154 | |
155 NSS_IMPLEMENT PRStatus | |
156 nssCryptoContext_ImportTrust ( | |
157 NSSCryptoContext *cc, | |
158 NSSTrust *trust | |
159 ) | |
160 { | |
161 PRStatus nssrv; | |
162 PORT_Assert(cc->certStore); | |
163 if (!cc->certStore) { | |
164 return PR_FAILURE; | |
165 } | |
166 nssrv = nssCertificateStore_AddTrust(cc->certStore, trust); | |
167 #if 0 | |
168 if (nssrv == PR_SUCCESS) { | |
169 trust->object.cryptoContext = cc; | |
170 } | |
171 #endif | |
172 return nssrv; | |
173 } | |
174 | |
175 NSS_IMPLEMENT PRStatus | |
176 nssCryptoContext_ImportSMIMEProfile ( | |
177 NSSCryptoContext *cc, | |
178 nssSMIMEProfile *profile | |
179 ) | |
180 { | |
181 PRStatus nssrv; | |
182 PORT_Assert(cc->certStore); | |
183 if (!cc->certStore) { | |
184 return PR_FAILURE; | |
185 } | |
186 nssrv = nssCertificateStore_AddSMIMEProfile(cc->certStore, profile); | |
187 #if 0 | |
188 if (nssrv == PR_SUCCESS) { | |
189 profile->object.cryptoContext = cc; | |
190 } | |
191 #endif | |
192 return nssrv; | |
193 } | |
194 | |
195 NSS_IMPLEMENT NSSCertificate * | |
196 NSSCryptoContext_FindBestCertificateByNickname ( | |
197 NSSCryptoContext *cc, | |
198 const NSSUTF8 *name, | |
199 NSSTime *timeOpt, /* NULL for "now" */ | |
200 NSSUsage *usage, | |
201 NSSPolicies *policiesOpt /* NULL for none */ | |
202 ) | |
203 { | |
204 NSSCertificate **certs; | |
205 NSSCertificate *rvCert = NULL; | |
206 PORT_Assert(cc->certStore); | |
207 if (!cc->certStore) { | |
208 return NULL; | |
209 } | |
210 certs = nssCertificateStore_FindCertificatesByNickname(cc->certStore, | |
211 name, | |
212 NULL, 0, NULL); | |
213 if (certs) { | |
214 rvCert = nssCertificateArray_FindBestCertificate(certs, | |
215 timeOpt, | |
216 usage, | |
217 policiesOpt); | |
218 nssCertificateArray_Destroy(certs); | |
219 } | |
220 return rvCert; | |
221 } | |
222 | |
223 NSS_IMPLEMENT NSSCertificate ** | |
224 NSSCryptoContext_FindCertificatesByNickname ( | |
225 NSSCryptoContext *cc, | |
226 NSSUTF8 *name, | |
227 NSSCertificate *rvOpt[], | |
228 PRUint32 maximumOpt, /* 0 for no max */ | |
229 NSSArena *arenaOpt | |
230 ) | |
231 { | |
232 NSSCertificate **rvCerts; | |
233 PORT_Assert(cc->certStore); | |
234 if (!cc->certStore) { | |
235 return NULL; | |
236 } | |
237 rvCerts = nssCertificateStore_FindCertificatesByNickname(cc->certStore, | |
238 name, | |
239 rvOpt, | |
240 maximumOpt, | |
241 arenaOpt); | |
242 return rvCerts; | |
243 } | |
244 | |
245 NSS_IMPLEMENT NSSCertificate * | |
246 NSSCryptoContext_FindCertificateByIssuerAndSerialNumber ( | |
247 NSSCryptoContext *cc, | |
248 NSSDER *issuer, | |
249 NSSDER *serialNumber | |
250 ) | |
251 { | |
252 PORT_Assert(cc->certStore); | |
253 if (!cc->certStore) { | |
254 return NULL; | |
255 } | |
256 return nssCertificateStore_FindCertificateByIssuerAndSerialNumber( | |
257 cc->certStore, | |
258 issuer, | |
259 serialNumber); | |
260 } | |
261 | |
262 NSS_IMPLEMENT NSSCertificate * | |
263 NSSCryptoContext_FindBestCertificateBySubject ( | |
264 NSSCryptoContext *cc, | |
265 NSSDER *subject, | |
266 NSSTime *timeOpt, | |
267 NSSUsage *usage, | |
268 NSSPolicies *policiesOpt | |
269 ) | |
270 { | |
271 NSSCertificate **certs; | |
272 NSSCertificate *rvCert = NULL; | |
273 PORT_Assert(cc->certStore); | |
274 if (!cc->certStore) { | |
275 return NULL; | |
276 } | |
277 certs = nssCertificateStore_FindCertificatesBySubject(cc->certStore, | |
278 subject, | |
279 NULL, 0, NULL); | |
280 if (certs) { | |
281 rvCert = nssCertificateArray_FindBestCertificate(certs, | |
282 timeOpt, | |
283 usage, | |
284 policiesOpt); | |
285 nssCertificateArray_Destroy(certs); | |
286 } | |
287 return rvCert; | |
288 } | |
289 | |
290 NSS_IMPLEMENT NSSCertificate ** | |
291 nssCryptoContext_FindCertificatesBySubject ( | |
292 NSSCryptoContext *cc, | |
293 NSSDER *subject, | |
294 NSSCertificate *rvOpt[], | |
295 PRUint32 maximumOpt, /* 0 for no max */ | |
296 NSSArena *arenaOpt | |
297 ) | |
298 { | |
299 NSSCertificate **rvCerts; | |
300 PORT_Assert(cc->certStore); | |
301 if (!cc->certStore) { | |
302 return NULL; | |
303 } | |
304 rvCerts = nssCertificateStore_FindCertificatesBySubject(cc->certStore, | |
305 subject, | |
306 rvOpt, | |
307 maximumOpt, | |
308 arenaOpt); | |
309 return rvCerts; | |
310 } | |
311 | |
312 NSS_IMPLEMENT NSSCertificate ** | |
313 NSSCryptoContext_FindCertificatesBySubject ( | |
314 NSSCryptoContext *cc, | |
315 NSSDER *subject, | |
316 NSSCertificate *rvOpt[], | |
317 PRUint32 maximumOpt, /* 0 for no max */ | |
318 NSSArena *arenaOpt | |
319 ) | |
320 { | |
321 return nssCryptoContext_FindCertificatesBySubject(cc, subject, | |
322 rvOpt, maximumOpt, | |
323 arenaOpt); | |
324 } | |
325 | |
326 NSS_IMPLEMENT NSSCertificate * | |
327 NSSCryptoContext_FindBestCertificateByNameComponents ( | |
328 NSSCryptoContext *cc, | |
329 NSSUTF8 *nameComponents, | |
330 NSSTime *timeOpt, | |
331 NSSUsage *usage, | |
332 NSSPolicies *policiesOpt | |
333 ) | |
334 { | |
335 nss_SetError(NSS_ERROR_NOT_FOUND); | |
336 return NULL; | |
337 } | |
338 | |
339 NSS_IMPLEMENT NSSCertificate ** | |
340 NSSCryptoContext_FindCertificatesByNameComponents ( | |
341 NSSCryptoContext *cc, | |
342 NSSUTF8 *nameComponents, | |
343 NSSCertificate *rvOpt[], | |
344 PRUint32 maximumOpt, /* 0 for no max */ | |
345 NSSArena *arenaOpt | |
346 ) | |
347 { | |
348 nss_SetError(NSS_ERROR_NOT_FOUND); | |
349 return NULL; | |
350 } | |
351 | |
352 NSS_IMPLEMENT NSSCertificate * | |
353 NSSCryptoContext_FindCertificateByEncodedCertificate ( | |
354 NSSCryptoContext *cc, | |
355 NSSBER *encodedCertificate | |
356 ) | |
357 { | |
358 PORT_Assert(cc->certStore); | |
359 if (!cc->certStore) { | |
360 return NULL; | |
361 } | |
362 return nssCertificateStore_FindCertificateByEncodedCertificate( | |
363 cc->certStore, | |
364 encodedCertificate); | |
365 } | |
366 | |
367 NSS_IMPLEMENT NSSCertificate * | |
368 NSSCryptoContext_FindBestCertificateByEmail ( | |
369 NSSCryptoContext *cc, | |
370 NSSASCII7 *email, | |
371 NSSTime *timeOpt, | |
372 NSSUsage *usage, | |
373 NSSPolicies *policiesOpt | |
374 ) | |
375 { | |
376 NSSCertificate **certs; | |
377 NSSCertificate *rvCert = NULL; | |
378 | |
379 PORT_Assert(cc->certStore); | |
380 if (!cc->certStore) { | |
381 return NULL; | |
382 } | |
383 certs = nssCertificateStore_FindCertificatesByEmail(cc->certStore, | |
384 email, | |
385 NULL, 0, NULL); | |
386 if (certs) { | |
387 rvCert = nssCertificateArray_FindBestCertificate(certs, | |
388 timeOpt, | |
389 usage, | |
390 policiesOpt); | |
391 nssCertificateArray_Destroy(certs); | |
392 } | |
393 return rvCert; | |
394 } | |
395 | |
396 NSS_IMPLEMENT NSSCertificate ** | |
397 NSSCryptoContext_FindCertificatesByEmail ( | |
398 NSSCryptoContext *cc, | |
399 NSSASCII7 *email, | |
400 NSSCertificate *rvOpt[], | |
401 PRUint32 maximumOpt, /* 0 for no max */ | |
402 NSSArena *arenaOpt | |
403 ) | |
404 { | |
405 NSSCertificate **rvCerts; | |
406 PORT_Assert(cc->certStore); | |
407 if (!cc->certStore) { | |
408 return NULL; | |
409 } | |
410 rvCerts = nssCertificateStore_FindCertificatesByEmail(cc->certStore, | |
411 email, | |
412 rvOpt, | |
413 maximumOpt, | |
414 arenaOpt); | |
415 return rvCerts; | |
416 } | |
417 | |
418 NSS_IMPLEMENT NSSCertificate * | |
419 NSSCryptoContext_FindCertificateByOCSPHash ( | |
420 NSSCryptoContext *cc, | |
421 NSSItem *hash | |
422 ) | |
423 { | |
424 nss_SetError(NSS_ERROR_NOT_FOUND); | |
425 return NULL; | |
426 } | |
427 | |
428 NSS_IMPLEMENT NSSCertificate * | |
429 NSSCryptoContext_FindBestUserCertificate ( | |
430 NSSCryptoContext *cc, | |
431 NSSTime *timeOpt, | |
432 NSSUsage *usage, | |
433 NSSPolicies *policiesOpt | |
434 ) | |
435 { | |
436 nss_SetError(NSS_ERROR_NOT_FOUND); | |
437 return NULL; | |
438 } | |
439 | |
440 NSS_IMPLEMENT NSSCertificate ** | |
441 NSSCryptoContext_FindUserCertificates ( | |
442 NSSCryptoContext *cc, | |
443 NSSTime *timeOpt, | |
444 NSSUsage *usageOpt, | |
445 NSSPolicies *policiesOpt, | |
446 NSSCertificate **rvOpt, | |
447 PRUint32 rvLimit, /* zero for no limit */ | |
448 NSSArena *arenaOpt | |
449 ) | |
450 { | |
451 nss_SetError(NSS_ERROR_NOT_FOUND); | |
452 return NULL; | |
453 } | |
454 | |
455 NSS_IMPLEMENT NSSCertificate * | |
456 NSSCryptoContext_FindBestUserCertificateForSSLClientAuth ( | |
457 NSSCryptoContext *cc, | |
458 NSSUTF8 *sslHostOpt, | |
459 NSSDER *rootCAsOpt[], /* null pointer for none */ | |
460 PRUint32 rootCAsMaxOpt, /* zero means list is null-terminated */ | |
461 NSSAlgorithmAndParameters *apOpt, | |
462 NSSPolicies *policiesOpt | |
463 ) | |
464 { | |
465 nss_SetError(NSS_ERROR_NOT_FOUND); | |
466 return NULL; | |
467 } | |
468 | |
469 NSS_IMPLEMENT NSSCertificate ** | |
470 NSSCryptoContext_FindUserCertificatesForSSLClientAuth ( | |
471 NSSCryptoContext *cc, | |
472 NSSUTF8 *sslHostOpt, | |
473 NSSDER *rootCAsOpt[], /* null pointer for none */ | |
474 PRUint32 rootCAsMaxOpt, /* zero means list is null-terminated */ | |
475 NSSAlgorithmAndParameters *apOpt, | |
476 NSSPolicies *policiesOpt, | |
477 NSSCertificate **rvOpt, | |
478 PRUint32 rvLimit, /* zero for no limit */ | |
479 NSSArena *arenaOpt | |
480 ) | |
481 { | |
482 nss_SetError(NSS_ERROR_NOT_FOUND); | |
483 return NULL; | |
484 } | |
485 | |
486 NSS_IMPLEMENT NSSCertificate * | |
487 NSSCryptoContext_FindBestUserCertificateForEmailSigning ( | |
488 NSSCryptoContext *cc, | |
489 NSSASCII7 *signerOpt, | |
490 NSSASCII7 *recipientOpt, | |
491 /* anything more here? */ | |
492 NSSAlgorithmAndParameters *apOpt, | |
493 NSSPolicies *policiesOpt | |
494 ) | |
495 { | |
496 nss_SetError(NSS_ERROR_NOT_FOUND); | |
497 return NULL; | |
498 } | |
499 | |
500 NSS_IMPLEMENT NSSCertificate * | |
501 NSSCryptoContext_FindUserCertificatesForEmailSigning ( | |
502 NSSCryptoContext *cc, | |
503 NSSASCII7 *signerOpt, /* fgmr or a more general name? */ | |
504 NSSASCII7 *recipientOpt, | |
505 /* anything more here? */ | |
506 NSSAlgorithmAndParameters *apOpt, | |
507 NSSPolicies *policiesOpt, | |
508 NSSCertificate **rvOpt, | |
509 PRUint32 rvLimit, /* zero for no limit */ | |
510 NSSArena *arenaOpt | |
511 ) | |
512 { | |
513 nss_SetError(NSS_ERROR_NOT_FOUND); | |
514 return NULL; | |
515 } | |
516 | |
517 NSS_IMPLEMENT NSSTrust * | |
518 nssCryptoContext_FindTrustForCertificate ( | |
519 NSSCryptoContext *cc, | |
520 NSSCertificate *cert | |
521 ) | |
522 { | |
523 PORT_Assert(cc->certStore); | |
524 if (!cc->certStore) { | |
525 return NULL; | |
526 } | |
527 return nssCertificateStore_FindTrustForCertificate(cc->certStore, cert); | |
528 } | |
529 | |
530 NSS_IMPLEMENT nssSMIMEProfile * | |
531 nssCryptoContext_FindSMIMEProfileForCertificate ( | |
532 NSSCryptoContext *cc, | |
533 NSSCertificate *cert | |
534 ) | |
535 { | |
536 PORT_Assert(cc->certStore); | |
537 if (!cc->certStore) { | |
538 return NULL; | |
539 } | |
540 return nssCertificateStore_FindSMIMEProfileForCertificate(cc->certStore, | |
541 cert); | |
542 } | |
543 | |
544 NSS_IMPLEMENT PRStatus | |
545 NSSCryptoContext_GenerateKeyPair ( | |
546 NSSCryptoContext *cc, | |
547 NSSAlgorithmAndParameters *ap, | |
548 NSSPrivateKey **pvkOpt, | |
549 NSSPublicKey **pbkOpt, | |
550 PRBool privateKeyIsSensitive, | |
551 NSSToken *destination, | |
552 NSSCallback *uhhOpt | |
553 ) | |
554 { | |
555 nss_SetError(NSS_ERROR_NOT_FOUND); | |
556 return PR_FAILURE; | |
557 } | |
558 | |
559 NSS_IMPLEMENT NSSSymmetricKey * | |
560 NSSCryptoContext_GenerateSymmetricKey ( | |
561 NSSCryptoContext *cc, | |
562 NSSAlgorithmAndParameters *ap, | |
563 PRUint32 keysize, | |
564 NSSToken *destination, | |
565 NSSCallback *uhhOpt | |
566 ) | |
567 { | |
568 nss_SetError(NSS_ERROR_NOT_FOUND); | |
569 return NULL; | |
570 } | |
571 | |
572 NSS_IMPLEMENT NSSSymmetricKey * | |
573 NSSCryptoContext_GenerateSymmetricKeyFromPassword ( | |
574 NSSCryptoContext *cc, | |
575 NSSAlgorithmAndParameters *ap, | |
576 NSSUTF8 *passwordOpt, /* if null, prompt */ | |
577 NSSToken *destinationOpt, | |
578 NSSCallback *uhhOpt | |
579 ) | |
580 { | |
581 nss_SetError(NSS_ERROR_NOT_FOUND); | |
582 return NULL; | |
583 } | |
584 | |
585 NSS_IMPLEMENT NSSSymmetricKey * | |
586 NSSCryptoContext_FindSymmetricKeyByAlgorithmAndKeyID ( | |
587 NSSCryptoContext *cc, | |
588 NSSOID *algorithm, | |
589 NSSItem *keyID, | |
590 NSSCallback *uhhOpt | |
591 ) | |
592 { | |
593 nss_SetError(NSS_ERROR_NOT_FOUND); | |
594 return NULL; | |
595 } | |
596 | |
597 struct token_session_str { | |
598 NSSToken *token; | |
599 nssSession *session; | |
600 }; | |
601 | |
602 NSS_IMPLEMENT NSSItem * | |
603 NSSCryptoContext_Decrypt ( | |
604 NSSCryptoContext *cc, | |
605 NSSAlgorithmAndParameters *apOpt, | |
606 NSSItem *encryptedData, | |
607 NSSCallback *uhhOpt, | |
608 NSSItem *rvOpt, | |
609 NSSArena *arenaOpt | |
610 ) | |
611 { | |
612 nss_SetError(NSS_ERROR_NOT_FOUND); | |
613 return NULL; | |
614 } | |
615 | |
616 NSS_IMPLEMENT PRStatus | |
617 NSSCryptoContext_BeginDecrypt ( | |
618 NSSCryptoContext *cc, | |
619 NSSAlgorithmAndParameters *apOpt, | |
620 NSSCallback *uhhOpt | |
621 ) | |
622 { | |
623 nss_SetError(NSS_ERROR_NOT_FOUND); | |
624 return PR_FAILURE; | |
625 } | |
626 | |
627 NSS_IMPLEMENT NSSItem * | |
628 NSSCryptoContext_ContinueDecrypt ( | |
629 NSSCryptoContext *cc, | |
630 NSSItem *data, | |
631 NSSItem *rvOpt, | |
632 NSSArena *arenaOpt | |
633 ) | |
634 { | |
635 nss_SetError(NSS_ERROR_NOT_FOUND); | |
636 return NULL; | |
637 } | |
638 | |
639 NSS_IMPLEMENT NSSItem * | |
640 NSSCryptoContext_FinishDecrypt ( | |
641 NSSCryptoContext *cc, | |
642 NSSItem *rvOpt, | |
643 NSSArena *arenaOpt | |
644 ) | |
645 { | |
646 nss_SetError(NSS_ERROR_NOT_FOUND); | |
647 return NULL; | |
648 } | |
649 | |
650 NSS_IMPLEMENT NSSItem * | |
651 NSSCryptoContext_Sign ( | |
652 NSSCryptoContext *cc, | |
653 NSSAlgorithmAndParameters *apOpt, | |
654 NSSItem *data, | |
655 NSSCallback *uhhOpt, | |
656 NSSItem *rvOpt, | |
657 NSSArena *arenaOpt | |
658 ) | |
659 { | |
660 nss_SetError(NSS_ERROR_NOT_FOUND); | |
661 return NULL; | |
662 } | |
663 | |
664 NSS_IMPLEMENT PRStatus | |
665 NSSCryptoContext_BeginSign ( | |
666 NSSCryptoContext *cc, | |
667 NSSAlgorithmAndParameters *apOpt, | |
668 NSSCallback *uhhOpt | |
669 ) | |
670 { | |
671 nss_SetError(NSS_ERROR_NOT_FOUND); | |
672 return PR_FAILURE; | |
673 } | |
674 | |
675 NSS_IMPLEMENT PRStatus | |
676 NSSCryptoContext_ContinueSign ( | |
677 NSSCryptoContext *cc, | |
678 NSSItem *data | |
679 ) | |
680 { | |
681 nss_SetError(NSS_ERROR_NOT_FOUND); | |
682 return PR_FAILURE; | |
683 } | |
684 | |
685 NSS_IMPLEMENT NSSItem * | |
686 NSSCryptoContext_FinishSign ( | |
687 NSSCryptoContext *cc, | |
688 NSSItem *rvOpt, | |
689 NSSArena *arenaOpt | |
690 ) | |
691 { | |
692 nss_SetError(NSS_ERROR_NOT_FOUND); | |
693 return NULL; | |
694 } | |
695 | |
696 NSS_IMPLEMENT NSSItem * | |
697 NSSCryptoContext_SignRecover ( | |
698 NSSCryptoContext *cc, | |
699 NSSAlgorithmAndParameters *apOpt, | |
700 NSSItem *data, | |
701 NSSCallback *uhhOpt, | |
702 NSSItem *rvOpt, | |
703 NSSArena *arenaOpt | |
704 ) | |
705 { | |
706 nss_SetError(NSS_ERROR_NOT_FOUND); | |
707 return NULL; | |
708 } | |
709 | |
710 NSS_IMPLEMENT PRStatus | |
711 NSSCryptoContext_BeginSignRecover ( | |
712 NSSCryptoContext *cc, | |
713 NSSAlgorithmAndParameters *apOpt, | |
714 NSSCallback *uhhOpt | |
715 ) | |
716 { | |
717 nss_SetError(NSS_ERROR_NOT_FOUND); | |
718 return PR_FAILURE; | |
719 } | |
720 | |
721 NSS_IMPLEMENT NSSItem * | |
722 NSSCryptoContext_ContinueSignRecover ( | |
723 NSSCryptoContext *cc, | |
724 NSSItem *data, | |
725 NSSItem *rvOpt, | |
726 NSSArena *arenaOpt | |
727 ) | |
728 { | |
729 nss_SetError(NSS_ERROR_NOT_FOUND); | |
730 return NULL; | |
731 } | |
732 | |
733 NSS_IMPLEMENT NSSItem * | |
734 NSSCryptoContext_FinishSignRecover ( | |
735 NSSCryptoContext *cc, | |
736 NSSItem *rvOpt, | |
737 NSSArena *arenaOpt | |
738 ) | |
739 { | |
740 nss_SetError(NSS_ERROR_NOT_FOUND); | |
741 return NULL; | |
742 } | |
743 | |
744 NSS_IMPLEMENT NSSSymmetricKey * | |
745 NSSCryptoContext_UnwrapSymmetricKey ( | |
746 NSSCryptoContext *cc, | |
747 NSSAlgorithmAndParameters *apOpt, | |
748 NSSItem *wrappedKey, | |
749 NSSCallback *uhhOpt | |
750 ) | |
751 { | |
752 nss_SetError(NSS_ERROR_NOT_FOUND); | |
753 return NULL; | |
754 } | |
755 | |
756 NSS_IMPLEMENT NSSSymmetricKey * | |
757 NSSCryptoContext_DeriveSymmetricKey ( | |
758 NSSCryptoContext *cc, | |
759 NSSPublicKey *bk, | |
760 NSSAlgorithmAndParameters *apOpt, | |
761 NSSOID *target, | |
762 PRUint32 keySizeOpt, /* zero for best allowed */ | |
763 NSSOperations operations, | |
764 NSSCallback *uhhOpt | |
765 ) | |
766 { | |
767 nss_SetError(NSS_ERROR_NOT_FOUND); | |
768 return NULL; | |
769 } | |
770 | |
771 NSS_IMPLEMENT NSSItem * | |
772 NSSCryptoContext_Encrypt ( | |
773 NSSCryptoContext *cc, | |
774 NSSAlgorithmAndParameters *apOpt, | |
775 NSSItem *data, | |
776 NSSCallback *uhhOpt, | |
777 NSSItem *rvOpt, | |
778 NSSArena *arenaOpt | |
779 ) | |
780 { | |
781 nss_SetError(NSS_ERROR_NOT_FOUND); | |
782 return NULL; | |
783 } | |
784 | |
785 NSS_IMPLEMENT PRStatus | |
786 NSSCryptoContext_BeginEncrypt ( | |
787 NSSCryptoContext *cc, | |
788 NSSAlgorithmAndParameters *apOpt, | |
789 NSSCallback *uhhOpt | |
790 ) | |
791 { | |
792 nss_SetError(NSS_ERROR_NOT_FOUND); | |
793 return PR_FAILURE; | |
794 } | |
795 | |
796 NSS_IMPLEMENT NSSItem * | |
797 NSSCryptoContext_ContinueEncrypt ( | |
798 NSSCryptoContext *cc, | |
799 NSSItem *data, | |
800 NSSItem *rvOpt, | |
801 NSSArena *arenaOpt | |
802 ) | |
803 { | |
804 nss_SetError(NSS_ERROR_NOT_FOUND); | |
805 return NULL; | |
806 } | |
807 | |
808 NSS_IMPLEMENT NSSItem * | |
809 NSSCryptoContext_FinishEncrypt ( | |
810 NSSCryptoContext *cc, | |
811 NSSItem *rvOpt, | |
812 NSSArena *arenaOpt | |
813 ) | |
814 { | |
815 nss_SetError(NSS_ERROR_NOT_FOUND); | |
816 return NULL; | |
817 } | |
818 | |
819 NSS_IMPLEMENT PRStatus | |
820 NSSCryptoContext_Verify ( | |
821 NSSCryptoContext *cc, | |
822 NSSAlgorithmAndParameters *apOpt, | |
823 NSSItem *data, | |
824 NSSItem *signature, | |
825 NSSCallback *uhhOpt | |
826 ) | |
827 { | |
828 nss_SetError(NSS_ERROR_NOT_FOUND); | |
829 return PR_FAILURE; | |
830 } | |
831 | |
832 NSS_IMPLEMENT PRStatus | |
833 NSSCryptoContext_BeginVerify ( | |
834 NSSCryptoContext *cc, | |
835 NSSAlgorithmAndParameters *apOpt, | |
836 NSSItem *signature, | |
837 NSSCallback *uhhOpt | |
838 ) | |
839 { | |
840 nss_SetError(NSS_ERROR_NOT_FOUND); | |
841 return PR_FAILURE; | |
842 } | |
843 | |
844 NSS_IMPLEMENT PRStatus | |
845 NSSCryptoContext_ContinueVerify ( | |
846 NSSCryptoContext *cc, | |
847 NSSItem *data | |
848 ) | |
849 { | |
850 nss_SetError(NSS_ERROR_NOT_FOUND); | |
851 return PR_FAILURE; | |
852 } | |
853 | |
854 NSS_IMPLEMENT PRStatus | |
855 NSSCryptoContext_FinishVerify ( | |
856 NSSCryptoContext *cc | |
857 ) | |
858 { | |
859 nss_SetError(NSS_ERROR_NOT_FOUND); | |
860 return PR_FAILURE; | |
861 } | |
862 | |
863 NSS_IMPLEMENT NSSItem * | |
864 NSSCryptoContext_VerifyRecover ( | |
865 NSSCryptoContext *cc, | |
866 NSSAlgorithmAndParameters *apOpt, | |
867 NSSItem *signature, | |
868 NSSCallback *uhhOpt, | |
869 NSSItem *rvOpt, | |
870 NSSArena *arenaOpt | |
871 ) | |
872 { | |
873 nss_SetError(NSS_ERROR_NOT_FOUND); | |
874 return NULL; | |
875 } | |
876 | |
877 NSS_IMPLEMENT PRStatus | |
878 NSSCryptoContext_BeginVerifyRecover ( | |
879 NSSCryptoContext *cc, | |
880 NSSAlgorithmAndParameters *apOpt, | |
881 NSSCallback *uhhOpt | |
882 ) | |
883 { | |
884 nss_SetError(NSS_ERROR_NOT_FOUND); | |
885 return PR_FAILURE; | |
886 } | |
887 | |
888 NSS_IMPLEMENT NSSItem * | |
889 NSSCryptoContext_ContinueVerifyRecover ( | |
890 NSSCryptoContext *cc, | |
891 NSSItem *data, | |
892 NSSItem *rvOpt, | |
893 NSSArena *arenaOpt | |
894 ) | |
895 { | |
896 nss_SetError(NSS_ERROR_NOT_FOUND); | |
897 return NULL; | |
898 } | |
899 | |
900 NSS_IMPLEMENT NSSItem * | |
901 NSSCryptoContext_FinishVerifyRecover ( | |
902 NSSCryptoContext *cc, | |
903 NSSItem *rvOpt, | |
904 NSSArena *arenaOpt | |
905 ) | |
906 { | |
907 nss_SetError(NSS_ERROR_NOT_FOUND); | |
908 return NULL; | |
909 } | |
910 | |
911 NSS_IMPLEMENT NSSItem * | |
912 NSSCryptoContext_WrapSymmetricKey ( | |
913 NSSCryptoContext *cc, | |
914 NSSAlgorithmAndParameters *apOpt, | |
915 NSSSymmetricKey *keyToWrap, | |
916 NSSCallback *uhhOpt, | |
917 NSSItem *rvOpt, | |
918 NSSArena *arenaOpt | |
919 ) | |
920 { | |
921 nss_SetError(NSS_ERROR_NOT_FOUND); | |
922 return NULL; | |
923 } | |
924 | |
925 NSS_IMPLEMENT NSSItem * | |
926 NSSCryptoContext_Digest ( | |
927 NSSCryptoContext *cc, | |
928 NSSAlgorithmAndParameters *apOpt, | |
929 NSSItem *data, | |
930 NSSCallback *uhhOpt, | |
931 NSSItem *rvOpt, | |
932 NSSArena *arenaOpt | |
933 ) | |
934 { | |
935 return nssToken_Digest(cc->token, cc->session, apOpt, | |
936 data, rvOpt, arenaOpt); | |
937 } | |
938 | |
939 NSS_IMPLEMENT PRStatus | |
940 NSSCryptoContext_BeginDigest ( | |
941 NSSCryptoContext *cc, | |
942 NSSAlgorithmAndParameters *apOpt, | |
943 NSSCallback *uhhOpt | |
944 ) | |
945 { | |
946 return nssToken_BeginDigest(cc->token, cc->session, apOpt); | |
947 } | |
948 | |
949 NSS_IMPLEMENT PRStatus | |
950 NSSCryptoContext_ContinueDigest ( | |
951 NSSCryptoContext *cc, | |
952 NSSAlgorithmAndParameters *apOpt, | |
953 NSSItem *item | |
954 ) | |
955 { | |
956 /* | |
957 NSSAlgorithmAndParameters *ap; | |
958 ap = (apOpt) ? apOpt : cc->ap; | |
959 */ | |
960 /* why apOpt? can't change it at this point... */ | |
961 return nssToken_ContinueDigest(cc->token, cc->session, item); | |
962 } | |
963 | |
964 NSS_IMPLEMENT NSSItem * | |
965 NSSCryptoContext_FinishDigest ( | |
966 NSSCryptoContext *cc, | |
967 NSSItem *rvOpt, | |
968 NSSArena *arenaOpt | |
969 ) | |
970 { | |
971 return nssToken_FinishDigest(cc->token, cc->session, rvOpt, arenaOpt); | |
972 } | |
973 | |
974 NSS_IMPLEMENT NSSCryptoContext * | |
975 NSSCryptoContext_Clone ( | |
976 NSSCryptoContext *cc | |
977 ) | |
978 { | |
979 nss_SetError(NSS_ERROR_NOT_FOUND); | |
980 return NULL; | |
981 } | |
982 |