|
22 | 22 | #include "TRNG/nist_algs.h" |
23 | 23 | #include "tracer.h" |
24 | 24 |
|
| 25 | +/** @brief this is the public key that complements the private key */ |
| 26 | +/* used to sign the modules within the cryptographic */ |
| 27 | +/* boundary at build time */ |
| 28 | +/* The private key at this time is stored in a file */ |
| 29 | +/* named icc/privkey.rsa */ |
| 30 | +/* \known Data: (rsa_pub_key) RSA public key used to verify |
| 31 | + the ICC shared library signatures |
| 32 | +*/ |
| 33 | +#include "pubkey.h" |
| 34 | + |
25 | 35 |
|
26 | 36 | #if defined(_WIN32) |
27 | 37 | #include <fcntl.h> |
@@ -826,52 +836,6 @@ static const unsigned char cmac_ka[] = { |
826 | 836 | 0xbd,0x4b,0xf2,0x8d,0x8c,0x37,0xc3,0x5c |
827 | 837 | }; |
828 | 838 |
|
829 | | -/** @brief this is the public key that complements the private key */ |
830 | | -/* used to sign the modules within the cryptographic */ |
831 | | -/* boundary at build time */ |
832 | | -/* The private key at this time is stored in a file */ |
833 | | -/* named icc/privkey.rsa */ |
834 | | -/** \known Data: (rsa_pub_key_DER) RSA public key used to verify |
835 | | - the ICC shared library signatures |
836 | | -*/ |
837 | | -static const unsigned char rsa_pub_key_DER[] = |
838 | | - { |
839 | | - 0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01, |
840 | | - 0x00,0xD5,0x61,0x38,0x36,0x15,0x97,0xAD, |
841 | | - 0xDC,0x6D,0x4D,0x44,0x8E,0x06,0x45,0x36, |
842 | | - 0xB4,0x23,0x1A,0x69,0x82,0xD8,0xFE,0x9E, |
843 | | - 0xF0,0x74,0x45,0x87,0xE1,0xE3,0x7F,0x58, |
844 | | - 0x6D,0xA2,0x42,0xBB,0xAF,0xC6,0xC8,0x41, |
845 | | - 0xBE,0xCA,0x50,0x1D,0x02,0x96,0xFC,0xAB, |
846 | | - 0x66,0xDB,0xD5,0xE9,0x78,0x48,0x87,0x55, |
847 | | - 0x68,0xF6,0x2B,0x7A,0xD3,0x18,0xDA,0xC7, |
848 | | - 0x36,0xD0,0xD2,0x14,0xF8,0x93,0x2B,0x21, |
849 | | - 0x5E,0x7A,0x95,0xAC,0xB6,0x76,0x9A,0xFE, |
850 | | - 0x6C,0x31,0x4C,0x6D,0xC8,0xC7,0xDE,0x53, |
851 | | - 0x53,0xB5,0x98,0x87,0x2F,0x9D,0x96,0x6B, |
852 | | - 0x21,0xC0,0x83,0x6E,0xFC,0x13,0x39,0x28, |
853 | | - 0x9B,0xBB,0x76,0xC7,0xF6,0x4E,0xDE,0x69, |
854 | | - 0xCE,0xE0,0x4B,0x35,0x4D,0xC5,0xB9,0xE6, |
855 | | - 0x96,0xDD,0xD1,0xB4,0x1C,0xE9,0xDC,0xE3, |
856 | | - 0x7A,0x9C,0x74,0x19,0x71,0xCD,0xFE,0xF7, |
857 | | - 0xEA,0x4E,0xC5,0x5E,0x7C,0xE7,0xA7,0xE7, |
858 | | - 0x09,0x8C,0xB6,0xA8,0xC2,0x9F,0x1B,0xAE, |
859 | | - 0x8C,0x22,0x08,0x05,0xF2,0xA4,0x53,0xA3, |
860 | | - 0x03,0x83,0x4E,0x36,0x99,0x0D,0x86,0xC2, |
861 | | - 0x00,0xE4,0xDF,0x82,0x29,0x88,0xA6,0x99, |
862 | | - 0x1C,0x36,0x80,0xF5,0xD7,0x88,0x99,0x0A, |
863 | | - 0x6F,0xB6,0x37,0xFF,0x99,0x87,0xF1,0x6C, |
864 | | - 0x7B,0x3F,0x63,0x94,0x5A,0x42,0x56,0xF6, |
865 | | - 0x34,0x80,0xC5,0x22,0x04,0x89,0x50,0x9F, |
866 | | - 0x36,0x6A,0x58,0x49,0xB4,0xF0,0x65,0x01, |
867 | | - 0xF8,0x69,0xD9,0x76,0x0E,0x9D,0x5F,0xAF, |
868 | | - 0xB5,0xFE,0x0D,0xE0,0xF8,0x41,0xB6,0x80, |
869 | | - 0xE5,0xA2,0x02,0xD0,0x8D,0xC6,0xAB,0xEE, |
870 | | - 0xAE,0x53,0x8C,0xBC,0x1E,0x97,0x4F,0xEE, |
871 | | - 0x9C,0xF3,0x47,0x08,0xDE,0x8C,0xB1,0xD8, |
872 | | - 0x1B,0x02,0x03,0x01,0x00,0x01 |
873 | | - }; |
874 | | - |
875 | 839 | #if defined(KNOWN) |
876 | 840 | /** \known Data. OpenSSL curve name corresponding to NIST B-233 |
877 | 841 | for binary field KAT |
@@ -5099,14 +5063,14 @@ EVP_PKEY *get_pubkey(ICC_STATUS *stat) { |
5099 | 5063 | SetStatusMem(NULL, stat, __FILE__, __LINE__); |
5100 | 5064 | } else { |
5101 | 5065 | const unsigned char *p1 = NULL; |
5102 | | - p1 = (unsigned char *)rsa_pub_key_DER; |
| 5066 | + p1 = (unsigned char *)rsa_pub_key; |
5103 | 5067 | /** \induced 157. Signature test, corrupt DER encoding |
5104 | 5068 | */ |
5105 | 5069 | if (157 == icc_failure) { |
5106 | 5070 | p1++; |
5107 | 5071 | } |
5108 | 5072 | rsaPKey = d2i_PublicKey(EVP_PKEY_RSA, &rsaPKey, (const unsigned char **)&p1, |
5109 | | - sizeof(rsa_pub_key_DER)); |
| 5073 | + sizeof(rsa_pub_key)); |
5110 | 5074 |
|
5111 | 5075 | /** \induced 153. iccSignature test. Couldn't convert embedded key to |
5112 | 5076 | binary representation. This should never happen as if OpenSSL isn't |
|
0 commit comments