OLD | NEW |
1 /* | 1 /* |
2 * Signature stuff. | 2 * Signature stuff. |
3 * | 3 * |
4 * This Source Code Form is subject to the terms of the Mozilla Public | 4 * This Source Code Form is subject to the terms of the Mozilla Public |
5 * License, v. 2.0. If a copy of the MPL was not distributed with this | 5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
7 /* $Id$ */ | 7 /* $Id$ */ |
8 | 8 |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include "cryptohi.h" | 10 #include "cryptohi.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 keyType = seckey_GetKeyType(signalg); | 49 keyType = seckey_GetKeyType(signalg); |
50 | 50 |
51 /* verify our key type */ | 51 /* verify our key type */ |
52 if (key->keyType != keyType && | 52 if (key->keyType != keyType && |
53 !((key->keyType == dsaKey) && (keyType == fortezzaKey)) ) { | 53 !((key->keyType == dsaKey) && (keyType == fortezzaKey)) ) { |
54 PORT_SetError(SEC_ERROR_INVALID_ALGORITHM); | 54 PORT_SetError(SEC_ERROR_INVALID_ALGORITHM); |
55 return 0; | 55 return 0; |
56 } | 56 } |
57 | 57 |
58 #ifndef NSS_ECC_MORE_THAN_SUITE_B | |
59 if (key->keyType == ecKey) { | |
60 PORT_SetError(SEC_ERROR_INVALID_ALGORITHM); | |
61 return 0; | |
62 } | |
63 #endif | |
64 | |
65 cx = (SGNContext*) PORT_ZAlloc(sizeof(SGNContext)); | 58 cx = (SGNContext*) PORT_ZAlloc(sizeof(SGNContext)); |
66 if (cx) { | 59 if (cx) { |
67 cx->hashalg = hashalg; | 60 cx->hashalg = hashalg; |
68 cx->signalg = signalg; | 61 cx->signalg = signalg; |
69 cx->key = key; | 62 cx->key = key; |
70 } | 63 } |
71 return cx; | 64 return cx; |
72 } | 65 } |
73 | 66 |
74 void | 67 void |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 case SEC_OID_SHA512: | 488 case SEC_OID_SHA512: |
496 sigTag = SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE; break; | 489 sigTag = SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE; break; |
497 default: | 490 default: |
498 break; | 491 break; |
499 } | 492 } |
500 default: | 493 default: |
501 break; | 494 break; |
502 } | 495 } |
503 return sigTag; | 496 return sigTag; |
504 } | 497 } |
OLD | NEW |