} else if (HAVE_OPT(INITIALIZE))
pkcs11_init(outfile, url, label, &cinfo);
else if (HAVE_OPT(DELETE))
- pkcs11_delete(outfile, url, 0, login, &cinfo);
+ pkcs11_delete(outfile, url, login, &cinfo);
else if (HAVE_OPT(GENERATE_ECC)) {
key_type = GNUTLS_PK_EC;
pkcs11_generate(outfile, url, key_type,
const char *label, int trusted,
int ca, int private,
unsigned int login, common_info_st *);
-void pkcs11_delete(FILE * outfile, const char *pkcs11_url, int batch,
+void pkcs11_delete(FILE * outfile, const char *pkcs11_url,
unsigned int login, common_info_st *);
void pkcs11_init(FILE * outfile, const char *pkcs11_url, const char *label,
common_info_st *);
"warning: --login was not specified and it may be required for this operation.\n")
void
-pkcs11_delete(FILE * outfile, const char *url, int batch,
+pkcs11_delete(FILE * outfile, const char *url,
unsigned int login_flags, common_info_st * info)
{
int ret;
if (login_flags) obj_flags = login_flags;
- if (!batch) {
+ if (info->batch == 0) {
pkcs11_list(outfile, url, PKCS11_TYPE_ALL, login_flags,
GNUTLS_PKCS11_URL_LIB, info);
ret =
FIX(url, outfile, 0, info);
CHECK_LOGIN_FLAG(login_flags);
+ if (label == NULL && info->batch == 0) {
+ label = read_str("warning: The object's label was not specified.\nLabel: ");
+ }
+
secret_key = load_secret_key(0, info);
if (secret_key != NULL) {
ret =
sleep(3);
}
+ if (label == NULL && info->batch == 0) {
+ label = read_str("warning: Label was not specified.\nLabel: ");
+ }
+
if (private == 1)
flags |= GNUTLS_PKCS11_OBJ_FLAG_MARK_PRIVATE;
else if (private == 0)