fix char* vs. const char* (tests related part)
This commit is contained in:
parent
0ceb1c1213
commit
3b663a199f
@ -399,7 +399,7 @@ int blake2b_512_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[64];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
@ -450,7 +450,7 @@ int blake2b_384_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[48];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
@ -497,7 +497,7 @@ int blake2b_256_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[32];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
@ -550,7 +550,7 @@ int blake2b_160_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[20];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
|
@ -387,7 +387,7 @@ int blake2s_256_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[32];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
@ -441,7 +441,7 @@ int blake2s_224_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[28];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
@ -485,7 +485,7 @@ int blake2s_160_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[20];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
@ -527,7 +527,7 @@ int blake2s_128_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[16];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
|
@ -191,7 +191,7 @@ int md2_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[16];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
|
@ -254,7 +254,7 @@ int md4_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct md4_test_case {
|
||||
char *input;
|
||||
const char *input;
|
||||
unsigned char hash[16];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
|
@ -314,7 +314,7 @@ int md5_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[16];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
|
@ -353,7 +353,7 @@ int rmd128_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[16];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
|
@ -412,7 +412,7 @@ int rmd160_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[20];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
|
@ -366,7 +366,7 @@ int rmd256_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[32];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
|
@ -431,7 +431,7 @@ int rmd320_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[40];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
|
@ -246,7 +246,7 @@ int sha1_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[20];
|
||||
} tests[] = {
|
||||
{ "abc",
|
||||
|
@ -88,7 +88,7 @@ int sha224_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[28];
|
||||
} tests[] = {
|
||||
{ "abc",
|
||||
|
@ -292,7 +292,7 @@ int sha256_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[32];
|
||||
} tests[] = {
|
||||
{ "abc",
|
||||
|
@ -90,7 +90,7 @@ int sha384_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[48];
|
||||
} tests[] = {
|
||||
{ "abc",
|
||||
|
@ -262,7 +262,7 @@ int sha512_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[64];
|
||||
} tests[] = {
|
||||
{ "abc",
|
||||
|
@ -90,7 +90,7 @@ int sha512_224_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[28];
|
||||
} tests[] = {
|
||||
{ "abc",
|
||||
|
@ -90,7 +90,7 @@ int sha512_256_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[32];
|
||||
} tests[] = {
|
||||
{ "abc",
|
||||
|
@ -735,7 +735,7 @@ int tiger_test(void)
|
||||
return CRYPT_NOP;
|
||||
#else
|
||||
static const struct {
|
||||
char *msg;
|
||||
const char *msg;
|
||||
unsigned char hash[24];
|
||||
} tests[] = {
|
||||
{ "",
|
||||
|
@ -142,8 +142,8 @@ int hmac_test(void)
|
||||
};
|
||||
|
||||
static const struct hmac_test_case {
|
||||
char *num;
|
||||
char *algo;
|
||||
const char *num;
|
||||
const char *algo;
|
||||
const unsigned char *key;
|
||||
unsigned long keylen;
|
||||
const unsigned char *data;
|
||||
|
@ -40,7 +40,7 @@ int hkdf_test(void)
|
||||
|
||||
static const struct hkdf_test_case {
|
||||
int num;
|
||||
char* Hash;
|
||||
const char* Hash;
|
||||
unsigned char IKM[80];
|
||||
unsigned long IKM_l;
|
||||
unsigned char salt[80];
|
||||
|
@ -35,9 +35,9 @@ int pkcs_5_test (void)
|
||||
#else
|
||||
|
||||
typedef struct {
|
||||
char* P;
|
||||
const char* P;
|
||||
unsigned long P_len;
|
||||
char* S;
|
||||
const char* S;
|
||||
unsigned long S_len;
|
||||
int c;
|
||||
unsigned long dkLen;
|
||||
|
@ -15,7 +15,7 @@
|
||||
Steffen Jaeckel
|
||||
*/
|
||||
|
||||
void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm)
|
||||
void run_cmd(int res, int line, const char *file, const char *cmd, const char *algorithm)
|
||||
{
|
||||
if (res != CRYPT_OK) {
|
||||
fprintf(stderr, "%s (%d)%s%s\n%s:%d:%s\n",
|
||||
|
@ -21,7 +21,7 @@ extern prng_state yarrow_prng;
|
||||
#define DOX(x, str) do { run_cmd((x), __LINE__, __FILE__, #x, (str)); } while (0)
|
||||
#endif
|
||||
|
||||
void run_cmd(int res, int line, char *file, char *cmd, const char *algorithm);
|
||||
void run_cmd(int res, int line, const char *file, const char *cmd, const char *algorithm);
|
||||
|
||||
void print_hex(const char* what, const void* v, const unsigned long l);
|
||||
|
||||
|
@ -53,11 +53,11 @@ static const unsigned char openssl_priv_dsa[] = {
|
||||
};
|
||||
|
||||
/* private key - raw hexadecimal numbers */
|
||||
static char *hex_g = "3B92E4FF5929150B08995A7BF2AD1440556FA047FF9099B344B3D4FC451505AE6722439CBA3710A5894737ECCCF5AEADA8B47A35CB9D935CEDE6B07E9694C4A60C7DD6708A094F814A0EC213FBEB16BFEAA4F456FF723005DE8A443FBEC6852655D62D1D1EDB15DAA445833C1797980B8D87F3490D90BDA9AB676E87687223DC";
|
||||
static char *hex_p = "C50A37515CABD618D5A270BD4A6F6B4AF9E139950F2B99387D9A64D64CB5967ADCEDACA8ACC61B655ADEDB0061251A182CEEA10790625E4D123190C70321FA09E7B173D78EAFDBFDBFB3EFADD1A12A036DE706924A852AFF7A0166531FEAC66741845AC06CED62F9C2626205A4FA48A066EC35C9A811FEB981ABEEBE31B6BFCF";
|
||||
static char *hex_q = "AA5BD7F4E5062413E58835CA00C7A635716194C5";
|
||||
static char *hex_x = "9936E5E4E9FB28BE91F5065FE8C935B3F5D81FC5";
|
||||
static char *hex_y = "5316B0FBBF598A5E5595C14FAC43B80853E6CF0D9223FAB184595239BFCBF22D383ADD935205497E2B12C46173E36F54BD96E5A7AAA95A58A4B767D2C0BDC81EB13A124F98C005EF395D6ABAB70B3BD8B795DD796EA2D28473470388B464D9B9B84FF1C934BBF97366F57C2E11FEC331E60838596781EB6D4127D70D74AFA035";
|
||||
static const char *hex_g = "3B92E4FF5929150B08995A7BF2AD1440556FA047FF9099B344B3D4FC451505AE6722439CBA3710A5894737ECCCF5AEADA8B47A35CB9D935CEDE6B07E9694C4A60C7DD6708A094F814A0EC213FBEB16BFEAA4F456FF723005DE8A443FBEC6852655D62D1D1EDB15DAA445833C1797980B8D87F3490D90BDA9AB676E87687223DC";
|
||||
static const char *hex_p = "C50A37515CABD618D5A270BD4A6F6B4AF9E139950F2B99387D9A64D64CB5967ADCEDACA8ACC61B655ADEDB0061251A182CEEA10790625E4D123190C70321FA09E7B173D78EAFDBFDBFB3EFADD1A12A036DE706924A852AFF7A0166531FEAC66741845AC06CED62F9C2626205A4FA48A066EC35C9A811FEB981ABEEBE31B6BFCF";
|
||||
static const char *hex_q = "AA5BD7F4E5062413E58835CA00C7A635716194C5";
|
||||
static const char *hex_x = "9936E5E4E9FB28BE91F5065FE8C935B3F5D81FC5";
|
||||
static const char *hex_y = "5316B0FBBF598A5E5595C14FAC43B80853E6CF0D9223FAB184595239BFCBF22D383ADD935205497E2B12C46173E36F54BD96E5A7AAA95A58A4B767D2C0BDC81EB13A124F98C005EF395D6ABAB70B3BD8B795DD796EA2D28473470388B464D9B9B84FF1C934BBF97366F57C2E11FEC331E60838596781EB6D4127D70D74AFA035";
|
||||
|
||||
/* The public part of test_dsa.key in SubjectPublicKeyInfo format */
|
||||
static const unsigned char openssl_pub_dsa[] = {
|
||||
|
@ -19,7 +19,7 @@ int file_test(void)
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F };
|
||||
unsigned char buf[200];
|
||||
unsigned long len;
|
||||
char *fname = "tests/test.key";
|
||||
const char *fname = "tests/test.key";
|
||||
FILE *in;
|
||||
int err, isha256, iaes;
|
||||
|
||||
|
@ -12,16 +12,16 @@
|
||||
static int _radix_to_bin_test(void)
|
||||
{
|
||||
/* RADIX 16 */
|
||||
char *ghex = "2";
|
||||
char *phex = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22"
|
||||
const char *ghex = "2";
|
||||
const char *phex = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22"
|
||||
"514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6"
|
||||
"F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D"
|
||||
"C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB"
|
||||
"9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E8603"
|
||||
"9B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA0510"
|
||||
"15728E5A8AACAA68FFFFFFFFFFFFFFFF";
|
||||
char *xhex = "A6681ADC386CE944C3DED9A7301DCC9C518250E3EDB62F959198F8DC0057DD6FB57ABAFD788198B1";
|
||||
char *yhex = "39046632C834418DFA07B3091538B614D1FB5DBB785C0FBEA3B98B295BC0CD076A88D9452141A269"
|
||||
const char *xhex = "A6681ADC386CE944C3DED9A7301DCC9C518250E3EDB62F959198F8DC0057DD6FB57ABAFD788198B1";
|
||||
const char *yhex = "39046632C834418DFA07B3091538B614D1FB5DBB785C0FBEA3B98B295BC0CD076A88D9452141A269"
|
||||
"E8BAEB1DD654EBA03A5705318D129754CDF4003A8C399240FBB8F162490F6F0DC70E414B6FEE8808"
|
||||
"6AFAA48E9F3A248EDC093452663D34E0E809D4F6BADBB36F80B6813EBF7C3281B862209E5604BDEA"
|
||||
"8B8F5F7BFDC3EEB7ADB73048289BCEA0F5A5CDEE7DF91CD1F0BA632F06DBE9BA7EF014B84B02D497"
|
||||
@ -29,27 +29,27 @@ static int _radix_to_bin_test(void)
|
||||
"32A5A2495EACBA99620ACD03A38345EBB6735E62330A8EE9AA6C8370410F5CD45AF37EE90A0DA95B"
|
||||
"E96FC939E88FE0BD2CD09FC8F524208C";
|
||||
/* RADIX 47 */
|
||||
char *gr47 = "2";
|
||||
char *pr47 = "F27Mg1SadOFIRbDOJ5dHgHiVF02Z1LHHQ6G5SLG2U8aTdfH1ETk4GARRE7WW99dBUBLb9e2OHFIaSM1A"
|
||||
const char *gr47 = "2";
|
||||
const char *pr47 = "F27Mg1SadOFIRbDOJ5dHgHiVF02Z1LHHQ6G5SLG2U8aTdfH1ETk4GARRE7WW99dBUBLb9e2OHFIaSM1A"
|
||||
"ag2LNNjgYa9I9CjQGJihL3J7A2SGQe8j5Ch8EHMj5jVbAYDiQKhhPhM6Hc56fKS40GUfJkGO7KJ6EXZQ"
|
||||
"VgbSa2AkPC65F91g0PaYie8AGNVaFKaV9HOQf3ia1iW4i6eCOB9CcBbH7TbQij8AEgjZ0VRBcLKc6UYO"
|
||||
"1Zc3I2Jc0h1H2HBEH8ONI3OYBbaPV6XhAd8WCc60D0RDBU3H9U7cWL28a0c90XNO0dh5RXEFBbUCE2ZG"
|
||||
"gh9XQSVIHkVbFIS5F5IGVOkiWAVc9i8BHB2V0UbGW6UdRTZVV";
|
||||
char *xr47 = "6bhO7O9NWFRgEMjdU0Y5POj3c1JP15MYEdIg3FO1PEjUY2aGYNSXcaF01R";
|
||||
char *yr47 = "3GNPNWEYfKML1cIbI7Cc1Z0O7aQLJgB734dO2i56LLYDdI4gHYk2GAbQH2WI97hNeC7dj3fPEH8I9gV9"
|
||||
const char *xr47 = "6bhO7O9NWFRgEMjdU0Y5POj3c1JP15MYEdIg3FO1PEjUY2aGYNSXcaF01R";
|
||||
const char *yr47 = "3GNPNWEYfKML1cIbI7Cc1Z0O7aQLJgB734dO2i56LLYDdI4gHYk2GAbQH2WI97hNeC7dj3fPEH8I9gV9"
|
||||
"U323AXj1AJXbFPFIHGOTdC29QUUeH2SSc6NWhfQDDXd5Q5iXCKEAUGX3SKcNFIfVOYJgZCLjfHYQdgOQ"
|
||||
"GCjKNgbEV7Hj34MU3b79iANX2DbMYfb9iGi78BWH2HYAd7IAhk7U0OYGHKJX1bIUUj1KBLhAUg46GaER"
|
||||
"G9W3ARMfBCj6kSdDF9TdkWAjWTDj722IeVJERC4bKU2VDFG20kDhCMF985efD1SS8DfXcdCHF1kDUkSA"
|
||||
"884FHYiFEPkaagQOBQaN9BNaEHNbbd002DCIIX5eMP4HgPJPF";
|
||||
/* RADIX 64 */
|
||||
char *gr64 = "2";
|
||||
char *pr64 = "3//////////yaFsg8XQC8qnCPYYu3S7D4f0au8YcVCT08BlgOx4viYKKe8UOuq1DtlbHcppJf36p0h2c"
|
||||
const char *gr64 = "2";
|
||||
const char *pr64 = "3//////////yaFsg8XQC8qnCPYYu3S7D4f0au8YcVCT08BlgOx4viYKKe8UOuq1DtlbHcppJf36p0h2c"
|
||||
"toNnGtJ+4rRMrHmaNaXRLsObv+nlHCGkccD+rh2/zSjlG6j+tkE6lxMecVfQwV915yIn/cIIXcKUpaMp"
|
||||
"t207oueME/1PZQI3OSLTEQQHO/gFqapr+3PLqZtAEjbXnYyrOWXLAxdjKf1t2Mbcrd33LEIhoO1F5qR0"
|
||||
"ZA625yCf1UHYuspZlZddSi60w60vidWwBi1wAFjSLTy6zCKidUAylsbLWN63cLINpgbMhb5T8c69Zw1H"
|
||||
"0LSevQYgogQF//////////";
|
||||
char *xr64 = "2cQ1hSE6pfHCFUsQSm7SoSKO9Gu+ssBvMHcFZS05VTRxLwklruWPYn";
|
||||
char *yr64 = "v16Ooo3H1ZVe7imaLEBOKqVjTktXS3xwZkOifMy3D1sg8sKKXGQ9fwBhh7TPKww0wLmKnZHANLCtq03g"
|
||||
const char *xr64 = "2cQ1hSE6pfHCFUsQSm7SoSKO9Gu+ssBvMHcFZS05VTRxLwklruWPYn";
|
||||
const char *yr64 = "v16Ooo3H1ZVe7imaLEBOKqVjTktXS3xwZkOifMy3D1sg8sKKXGQ9fwBhh7TPKww0wLmKnZHANLCtq03g"
|
||||
"CEP90+xZnOaaFRmt73a5BR+w826hwf8wVEYIEt0aqKcOzDE3e2TJskjkpRu2sWJw/V3A1k68WdbO4lUg"
|
||||
"BZrzx/SFkjwstC4WecywWzQNDxdtv7D7mkcCl1jlfkdxm5BXB0jINodqCOFSqTIfadQIMb6jEKnimsVW"
|
||||
"ktOLMDi2myguZBa66HKw8Xxj2FZAbeabUhBgPOWhD0wE3HUksSrvYCmgEwQfiWt113rpKMlD+wGeDgLl"
|
||||
@ -100,10 +100,10 @@ static int _radix_to_bin_test(void)
|
||||
|
||||
struct {
|
||||
int radix;
|
||||
void* g; int glen;
|
||||
void* p; int plen;
|
||||
void* x; int xlen;
|
||||
void* y; int ylen;
|
||||
const void* g; int glen;
|
||||
const void* p; int plen;
|
||||
const void* x; int xlen;
|
||||
const void* y; int ylen;
|
||||
} test[4] = {
|
||||
{ 256, gbin, sizeof(gbin), pbin, sizeof(pbin), xbin, sizeof(xbin), ybin, sizeof(ybin) },
|
||||
{ 16, ghex, strlen(ghex)+1, phex, strlen(phex)+1, xhex, strlen(xhex)+1, yhex, strlen(yhex)+1 },
|
||||
|
Loading…
Reference in New Issue
Block a user