Commit e61e8dc3 authored by Jan Včelák's avatar Jan Včelák 🚀

libdnssec: token availability check in pkcs11 init

parent b45821dd
......@@ -172,7 +172,15 @@ static int pkcs11_ctx_free(void *ctx)
static int pkcs11_init(void *ctx, const char *config)
{
return DNSSEC_NOT_IMPLEMENTED_ERROR;
/*
* Current keystore initialization is idempotent. We don't really
* initialize the token because don't want to wipe the data. We just
* check that the token is available the same way pkcs11_open() does.
*/
_cleanup_free_ char *url = NULL;
return safe_open(config, &url);
}
static int pkcs11_open(void *_ctx, const char *config)
......
......@@ -448,7 +448,7 @@ int main(int argc, char *argv[])
// key store access
r = dnssec_keystore_init(store, config);
ok(r == DNSSEC_NOT_IMPLEMENTED_ERROR, "dnssec_keystore_init(), not implemented");
ok(r == DNSSEC_EOK, "dnssec_keystore_init()");
r = dnssec_keystore_open(store, config);
ok(r == DNSSEC_EOK, "dnssec_keystore_open()");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment