diff options
author | Nikolay Sivov <nsivov@codeweavers.com> | 2020-09-01 21:00:18 +0300 |
---|---|---|
committer | Nikolay Sivov <nsivov@codeweavers.com> | 2020-09-01 21:09:55 +0300 |
commit | c3072208437f56371bc772671595becbcf85c119 (patch) | |
tree | 71f43c74ad34d07a58038e5b5ee6ceecbb64b471 | |
parent | 86c3a4db8f340ac03c47c694fb24c5110c5abf8e (diff) | |
download | gnutls-c3072208437f56371bc772671595becbcf85c119.tar.gz |
Add some tests for optional arguments in gnutls_privkey_import_rsa_raw().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
-rw-r--r-- | tests/key-import-export.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/key-import-export.c b/tests/key-import-export.c index 45434eeb2d..776a519dbe 100644 --- a/tests/key-import-export.c +++ b/tests/key-import-export.c @@ -341,6 +341,36 @@ int check_privkey_import_export(void) if (ret < 0) fail("error\n"); + /* Optional arguments */ + ret = gnutls_privkey_import_rsa_raw(key, &_rsa_m, &_rsa_e, &_rsa_d, &_rsa_p, &_rsa_q, NULL, NULL, NULL); + if (ret < 0) + fail("error\n"); + + ret = gnutls_privkey_import_rsa_raw(key, &_rsa_m, &_rsa_e, &_rsa_d, &_rsa_p, &_rsa_q, NULL, &_rsa_e1, &_rsa_e2); + if (ret < 0) + fail("error\n"); + + ret = gnutls_privkey_import_rsa_raw(key, &_rsa_m, &_rsa_e, &_rsa_d, &_rsa_p, &_rsa_q, NULL, &_rsa_e1, NULL); + if (ret < 0) + fail("error\n"); + + ret = gnutls_privkey_import_rsa_raw(key, &_rsa_m, &_rsa_e, &_rsa_d, &_rsa_p, &_rsa_q, NULL, NULL, &_rsa_e2); + if (ret < 0) + fail("error\n"); + + ret = gnutls_privkey_import_rsa_raw(key, &_rsa_m, &_rsa_e, &_rsa_d, &_rsa_p, &_rsa_q, &_rsa_u, NULL, NULL); + if (ret < 0) + fail("error\n"); + + ret = gnutls_privkey_import_rsa_raw(key, &_rsa_m, &_rsa_e, &_rsa_d, &_rsa_p, &_rsa_q, &_rsa_u, &_rsa_e1, NULL); + if (ret < 0) + fail("error\n"); + + ret = gnutls_privkey_import_rsa_raw(key, &_rsa_m, &_rsa_e, &_rsa_d, &_rsa_p, &_rsa_q, &_rsa_u, NULL, &_rsa_e2); + if (ret < 0) + fail("error\n"); + + /* Import/export */ ret = gnutls_privkey_import_rsa_raw(key, &_rsa_m, &_rsa_e, &_rsa_d, &_rsa_p, &_rsa_q, &_rsa_u, &_rsa_e1, &_rsa_e2); if (ret < 0) fail("error\n"); |