prom_key.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2002-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* This provides the interface to store a named key in stable local
* storage. These keys are retrieved and used by OBP and WAN boot
* to do decryption and HMAC verification of network-downloaded data.
*/
#include <sys/promimpl.h>
#ifdef PROM_32BIT_ADDRS
#endif /* PROM_32BIT_ADDRS */
int
int *status)
{
int rv;
int result;
#ifdef PROM_32BIT_ADDRS
return (-1);
}
/*
* A key length of zero is used to delete the named key.
* No need to reallocate and copy buf[] in this case.
*/
return (-1);
}
}
#endif /* PROM_32BIT_ADDRS */
/*
* The arguments to the SUNW,set-security-key service
* that stores a key are
* ci[0] the service name
* ci[1] the number of ``in'' arguments
* ci[2] the number of ``out'' arguments
* ci[3] the key's name, as a string
* ci[4] the key buffer itself
* ci[5] the length of the key buffer
*
* When p1275_cif_handler() returns, the return value is
* ci[6] the length of the key stored, or (if
* negative) an error code.
*/
#ifdef PROM_32BIT_ADDRS
#endif /* PROM_32BIT_ADDRS */
if (rv != 0)
return (-1);
if (result >= 0) {
*status = 0;
} else {
*reslen = 0;
}
return (0);
}
int
int *status)
{
int rv;
int result;
#ifdef PROM_32BIT_ADDRS
return (-1);
}
return (-1);
}
}
#endif /* PROM_32BIT_ADDRS */
/*
* The arguments to the SUNW,get-security-key service
* that stores a key are
* ci[0] the service name
* ci[1] the number of ``in'' arguments
* ci[2] the number of ``out'' arguments
* ci[3] the key's name, as a string
* ci[4] the key buffer itself
* ci[5] the length of the key buffer
*
* When p1275_cif_handler() returns, the return value is
* ci[6] the length of the key, or (if
* negative) an error code.
*/
#ifdef PROM_32BIT_ADDRS
}
#endif /* PROM_32BIT_ADDRS */
if (rv != 0)
return (-1);
if (result > 0) {
*status = 0;
} else {
*keylen = 0;
}
return (0);
}