/*
* 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
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <strings.h>
#include <libintl.h>
#include <locale.h>
#include <trousers/trousers.h>
#include "tpmadm.h"
extern cmdtable_t commands[];
static void
{
cmdtable_t *p;
gettext("where 'command' is one of the following:\n"));
}
}
int
{
char *progname;
cmdtable_t *p;
int ret;
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D. */
#endif
(void) textdomain(TEXT_DOMAIN);
argc--;
argv++;
if (argc <= 0) {
return (ERR_USAGE);
}
break;
}
}
return (ERR_USAGE);
}
return (ERR_FAIL);
(void) tpm_postamble(hContext);
return (ret);
}
/*
* Utility functions
*/
void
{
int i;
for (i = 0; i < len; i++) {
(void) printf(" ");
(void) printf("\n");
}
(void) printf("\n");
}
/*
* TSS convenience functions
*/
void
{
char *err_string;
/* Print the standard error string and error code. */
/* For a few special cases, add a more verbose error message. */
switch (ret) {
case TPM_E_DEACTIVATED:
case TPM_E_DISABLED:
gettext("Enable the TPM and restart Solaris.\n"));
break;
case TSP_ERROR(TSS_E_COMM_FAILURE):
gettext("Make sure the tcsd service "
"(svc:/application/security/tcsd) is running.\n"));
break;
}
}
int
{
if (ret) {
return (ERR_FAIL);
}
gettext("Capability 0x%x returned %u bytes "
return (ERR_FAIL);
}
if (ret) {
return (ERR_FAIL);
}
return (0);
}
int
{
if (ret) {
return (ERR_FAIL);
}
if (ret) {
return (ERR_FAIL);
}
}
return (0);
}
int
{
if (ret) {
return (ERR_FAIL);
}
}
int
{
if (ret) {
return (ERR_FAIL);
}
if (ret) {
(void) Tspi_Context_Close(*hContext);
return (ERR_FAIL);
}
if (ret) {
(void) Tspi_Context_Close(*hContext);
return (ERR_FAIL);
}
return (0);
}
int
{
if (ret) {
return (ERR_FAIL);
}
return (0);
}