/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*/
#include <stdio.h>
#include <strings.h>
#include <ctype.h>
#include <libgen.h>
#include <libintl.h>
#include <errno.h>
#include <kmfapiP.h>
#include "util.h"
static void
{
int i;
return;
"Search by Issuer\n"));
} else {
}
char *s = kmf_ku_to_string(
if (s != NULL) {
(void) printf("%s ", s);
}
}
(void) printf("\n");
} else {
}
char *s = kmf_oid_to_ekuname(
(void) printf("\t%s\t(%s)\n",
s ? s : "unknown");
}
} else {
}
" <null>\n"));
} else {
}
}
}
(void) printf("\n");
}
void
show_plugin(void)
{
/* List the built-in plugins */
(void) printf("pkcs11:kmf_pkcs11.so.1 (built-in)\n");
(void) printf("file:kmf_openssl.so.1 (built-in)\n");
/*
* If the NSS libraries are not installed in the system,
* then we will not show the nss plugin either.
*/
}
/* List non-default plugins, if there is any. */
(void) printf("\n");
else
(void) printf(";option=%s\n",
}
}
}
int
{
extern int optind_av;
extern char *optarg_av;
int sanity_err = 0;
!= EOF) {
switch (opt) {
case 'i':
if (list_plugin)
rv = KC_ERR_USAGE;
else {
gettext("Error dbfile input.\n"));
}
}
break;
case 'p':
if (list_plugin)
rv = KC_ERR_USAGE;
else {
if (policyname == NULL) {
gettext("Error policy name.\n"));
}
}
break;
case 'm':
break;
default:
gettext("Error input option.\n"));
rv = KC_ERR_USAGE;
break;
}
goto out;
}
/* No additional args allowed. */
if (argc) {
gettext("Error input option\n"));
rv = KC_ERR_USAGE;
goto out;
}
if (list_plugin) {
show_plugin();
goto out;
}
rv = KC_ERR_MEMORY;
goto out;
}
}
/* Check the access permission of the policy DB */
rv = KC_ERR_ACCESS;
goto out;
}
goto out;
}
if (policyname == NULL ||
found++;
"Policy Name: '%s' is invalid\n"),
sanity_err++;
} else {
}
}
}
if (!found) {
if (policyname)
"Cannot find policy '%s'\n"), policyname);
else
"any policies to display\n"));
} else if (sanity_err) {
}
out:
if (policyname != NULL)
return (rv);
}