#include <stdint.h>
#include <common.h>
+#define FIX(url) \
+ if (url == NULL) { \
+ fprintf(stderr, "warning: no token was provided; use --list-tokens for the available ones.\n" \
+ "warning: assuming 'pkcs11:'\n"); \
+ url = "pkcs11:"; \
+ }
+
void
pkcs11_delete(FILE * outfile, const char *url, int batch,
unsigned int login, common_info_st * info)
pkcs11_common();
- if (url == NULL)
- url = "pkcs11:";
+ FIX(url);
if (type == PKCS11_TYPE_TRUSTED) {
attrs = GNUTLS_PKCS11_OBJ_ATTR_CRT_TRUSTED;
pkcs11_common();
- if (url == NULL)
- url = "pkcs11:";
+ FIX(url);
ret = gnutls_pkcs11_obj_init(&obj);
if (ret < 0) {
pkcs11_common();
- if (url == NULL)
- url = "pkcs11:";
+ FIX(url);
ret = gnutls_pkcs11_obj_init(&obj);
if (ret < 0) {
pkcs11_common();
- if (url == NULL)
- url = "pkcs11:";
+ FIX(url);
secret_key = load_secret_key(0, info);
if (secret_key != NULL) {
pkcs11_common();
- if (url == NULL)
- url = "pkcs11:";
+ FIX(url);
if (private == 1)
flags |= GNUTLS_PKCS11_OBJ_FLAG_MARK_PRIVATE;
pkcs11_common();
- if (url == NULL)
- url = "pkcs11:";
+ FIX(url);
idx = 0;
do {
pkcs11_common();
- if (url == NULL)
- url = "pkcs11:";
+ FIX(url);
output = malloc(bytes);
if (output == NULL) {