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 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include "cryptohi.h" | 9 #include "cryptohi.h" |
10 #include "sechash.h" | 10 #include "sechash.h" |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 { | 438 { |
439 SECOidTag sigTag = SEC_OID_UNKNOWN; | 439 SECOidTag sigTag = SEC_OID_UNKNOWN; |
440 | 440 |
441 switch (keyType) { | 441 switch (keyType) { |
442 case rsaKey: | 442 case rsaKey: |
443 switch (hashAlgTag) { | 443 switch (hashAlgTag) { |
444 case SEC_OID_MD2: | 444 case SEC_OID_MD2: |
445 sigTag = SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION; break; | 445 sigTag = SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION; break; |
446 case SEC_OID_MD5: | 446 case SEC_OID_MD5: |
447 sigTag = SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION; break; | 447 sigTag = SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION; break; |
448 case SEC_OID_UNKNOWN: /* default for RSA if not specified */ | |
449 case SEC_OID_SHA1: | 448 case SEC_OID_SHA1: |
450 sigTag = SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION; break; | 449 sigTag = SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION; break; |
451 case SEC_OID_SHA224: | 450 case SEC_OID_SHA224: |
452 sigTag = SEC_OID_PKCS1_SHA224_WITH_RSA_ENCRYPTION; break; | 451 sigTag = SEC_OID_PKCS1_SHA224_WITH_RSA_ENCRYPTION; break; |
| 452 case SEC_OID_UNKNOWN: /* default for RSA if not specified */ |
453 case SEC_OID_SHA256: | 453 case SEC_OID_SHA256: |
454 sigTag = SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION; break; | 454 sigTag = SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION; break; |
455 case SEC_OID_SHA384: | 455 case SEC_OID_SHA384: |
456 sigTag = SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION; break; | 456 sigTag = SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION; break; |
457 case SEC_OID_SHA512: | 457 case SEC_OID_SHA512: |
458 sigTag = SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION; break; | 458 sigTag = SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION; break; |
459 default: | 459 default: |
460 break; | 460 break; |
461 } | 461 } |
462 break; | 462 break; |
(...skipping 24 matching lines...) Expand all Loading... |
487 case SEC_OID_SHA512: | 487 case SEC_OID_SHA512: |
488 sigTag = SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE; break; | 488 sigTag = SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE; break; |
489 default: | 489 default: |
490 break; | 490 break; |
491 } | 491 } |
492 default: | 492 default: |
493 break; | 493 break; |
494 } | 494 } |
495 return sigTag; | 495 return sigTag; |
496 } | 496 } |
OLD | NEW |