1*12611SJan.Pechanec@Sun.COM /* 2*12611SJan.Pechanec@Sun.COM * CDDL HEADER START 3*12611SJan.Pechanec@Sun.COM * 4*12611SJan.Pechanec@Sun.COM * The contents of this file are subject to the terms of the 5*12611SJan.Pechanec@Sun.COM * Common Development and Distribution License (the "License"). 6*12611SJan.Pechanec@Sun.COM * You may not use this file except in compliance with the License. 7*12611SJan.Pechanec@Sun.COM * 8*12611SJan.Pechanec@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*12611SJan.Pechanec@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*12611SJan.Pechanec@Sun.COM * See the License for the specific language governing permissions 11*12611SJan.Pechanec@Sun.COM * and limitations under the License. 12*12611SJan.Pechanec@Sun.COM * 13*12611SJan.Pechanec@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*12611SJan.Pechanec@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*12611SJan.Pechanec@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*12611SJan.Pechanec@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*12611SJan.Pechanec@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*12611SJan.Pechanec@Sun.COM * 19*12611SJan.Pechanec@Sun.COM * CDDL HEADER END 20*12611SJan.Pechanec@Sun.COM * 21*12611SJan.Pechanec@Sun.COM * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 22*12611SJan.Pechanec@Sun.COM * 23*12611SJan.Pechanec@Sun.COM * This is a private header file for the KMF certificate to name mapping 24*12611SJan.Pechanec@Sun.COM * framework. 25*12611SJan.Pechanec@Sun.COM */ 26*12611SJan.Pechanec@Sun.COM #ifndef _KMFMAPPER_H 27*12611SJan.Pechanec@Sun.COM #define _KMFMAPPER_H 28*12611SJan.Pechanec@Sun.COM 29*12611SJan.Pechanec@Sun.COM #pragma ident "@(#)kmfmapper.h 1.1 08/02/27 SMI" 30*12611SJan.Pechanec@Sun.COM 31*12611SJan.Pechanec@Sun.COM #ifdef __cplusplus 32*12611SJan.Pechanec@Sun.COM extern "C" { 33*12611SJan.Pechanec@Sun.COM #endif 34*12611SJan.Pechanec@Sun.COM 35*12611SJan.Pechanec@Sun.COM #define MAPPER_NAME_TEMPLATE "kmf_mapper_%s.so.1" 36*12611SJan.Pechanec@Sun.COM 37*12611SJan.Pechanec@Sun.COM #define MAPPER_ERROR_STRING_FUNCTION "mapper_get_error_str" 38*12611SJan.Pechanec@Sun.COM #define MAP_CERT_TO_NAME_FUNCTION "mapper_map_cert_to_name" 39*12611SJan.Pechanec@Sun.COM #define MATCH_CERT_TO_NAME_FUNCTION "mapper_match_cert_to_name" 40*12611SJan.Pechanec@Sun.COM #define MAPPER_FINISH_FUNCTION "mapper_finalize" 41*12611SJan.Pechanec@Sun.COM #define MAPPER_INIT_FUNCTION "mapper_initialize" 42*12611SJan.Pechanec@Sun.COM 43*12611SJan.Pechanec@Sun.COM /* KMF mapper policy record. */ 44*12611SJan.Pechanec@Sun.COM typedef struct { 45*12611SJan.Pechanec@Sun.COM /* 46*12611SJan.Pechanec@Sun.COM * Those four attributes are initialized from the policy database and 47*12611SJan.Pechanec@Sun.COM * are not to be changed for the life of the KMF session. 48*12611SJan.Pechanec@Sun.COM */ 49*12611SJan.Pechanec@Sun.COM char *mapname; 50*12611SJan.Pechanec@Sun.COM char *options; 51*12611SJan.Pechanec@Sun.COM char *pathname; 52*12611SJan.Pechanec@Sun.COM char *dir; 53*12611SJan.Pechanec@Sun.COM /* Current mapper. */ 54*12611SJan.Pechanec@Sun.COM void *dldesc; 55*12611SJan.Pechanec@Sun.COM /* 56*12611SJan.Pechanec@Sun.COM * The presently open mapper pathname and options. Can be based on the 57*12611SJan.Pechanec@Sun.COM * policy attributes or attributes provided directly to the 58*12611SJan.Pechanec@Sun.COM * kmf_cert_to_name_mapping_init(), thus overriding the policy settings. 59*12611SJan.Pechanec@Sun.COM */ 60*12611SJan.Pechanec@Sun.COM char *curpathname; 61*12611SJan.Pechanec@Sun.COM char *curoptions; 62*12611SJan.Pechanec@Sun.COM } KMF_MAPPER_RECORD; 63*12611SJan.Pechanec@Sun.COM 64*12611SJan.Pechanec@Sun.COM /* KMF mapper state record. */ 65*12611SJan.Pechanec@Sun.COM typedef struct { 66*12611SJan.Pechanec@Sun.COM /* 67*12611SJan.Pechanec@Sun.COM * (Processed) options. Transparent to KMF. Each mapper can store its 68*12611SJan.Pechanec@Sun.COM * data there since options can be unique to every KMF handle. 69*12611SJan.Pechanec@Sun.COM */ 70*12611SJan.Pechanec@Sun.COM void *options; 71*12611SJan.Pechanec@Sun.COM /* 72*12611SJan.Pechanec@Sun.COM * If the mapper returns KMF_ERR_INTERNAL the application may ask for 73*12611SJan.Pechanec@Sun.COM * the internal mapper error string. That error code is stored here. 74*12611SJan.Pechanec@Sun.COM */ 75*12611SJan.Pechanec@Sun.COM uint32_t lastmappererr; 76*12611SJan.Pechanec@Sun.COM } KMF_MAPPER_STATE; 77*12611SJan.Pechanec@Sun.COM 78*12611SJan.Pechanec@Sun.COM #ifdef __cplusplus 79*12611SJan.Pechanec@Sun.COM } 80*12611SJan.Pechanec@Sun.COM #endif 81*12611SJan.Pechanec@Sun.COM #endif /* _KMFMAPPER_H */ 82