Skip to content

Commit 2dd8bcd

Browse files
karel-msjaeckel
authored andcommitted
rsa_import_pkcs8 tests
1 parent 7af942a commit 2dd8bcd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ int test_process_dir(const char *path, void *ctx, dir_iter_cb process, dir_clean
100100
return CRYPT_FILE_NOTFOUND;
101101
while((de = readdir(d)) != NULL) {
102102
fname[0] = '\0';
103-
if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0)
103+
if (strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0 || strcmp(de->d_name, "README.txt") == 0)
104104
continue;
105105
strcat(fname, path);
106106
strcat(fname, "/");

tests/rsa_test.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,11 @@ static int _rsa_import_x509(const void *in, unsigned long inlen, void *key)
341341
}
342342
return rsa_import_x509(in, inlen, key);
343343
}
344+
345+
static int _rsa_import_pkcs8(const void *in, unsigned long inlen, void *key)
346+
{
347+
return rsa_import_pkcs8(in, inlen, "secret", 6, key);
348+
}
344349
#endif
345350

346351
int rsa_test(void)
@@ -370,6 +375,7 @@ int rsa_test(void)
370375

371376
#ifdef LTC_TEST_READDIR
372377
DO(test_process_dir("tests/rsa", &key, _rsa_import_x509, (dir_cleanup_cb)rsa_free, "rsa_test"));
378+
DO(test_process_dir("tests/rsa-pkcs8", &key, _rsa_import_pkcs8, (dir_cleanup_cb)rsa_free, "rsa_pkcs8_test"));
373379
#endif
374380

375381
DO(_rsa_issue_301(prng_idx));

0 commit comments

Comments
 (0)