nis_dhext.h 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* nis_dhext.h: NIS+ extended Diffie-Hellman interface.
*/
#ifndef _NIS_DHEXT_H
#define _NIS_DHEXT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <rpc/key_prot.h>
#define AUTH_DES_KEYLEN 192
#define AUTH_DES_ALGTYPE 0
#define AUTH_DES_AUTH_TYPE "DES"
#define AUTH_DES_KEY(k, a) (((k) == AUTH_DES_KEYLEN) && \
((a) == AUTH_DES_ALGTYPE))
#define BITS2NIBBLES(b) ((b)/4)
#define NIS_SVCNAME_NISD "nisd"
#define NIS_SVCNAME_NISPASSWD "nispasswd"
typedef struct extdhkey {
} extdhkey_t;
/*
* NIS+ Security conf file
*/
#define NIS_SEC_CF_PATHNAME "/etc/rpcsec/nisplussec.conf"
#define NIS_SEC_CF_MAX_FLDLEN MAX_GSS_NAME
typedef struct {
char *mechname;
char *alias;
char *qop;
} mechanism_t;
/* The string that indicates AUTH_DES compat in the nis sec conf file. */
#define NIS_SEC_CF_DES_ALIAS "des"
/*
* The value a keylen or algtype mechanism_t element will be set
* to if the conf file indicates "not applicable" for that field.
* Except if the alias is equal to NIS_SEC_CF_DES_ALIAS,
* then the keylen is set to 192 and the algtype to 0.
*/
#define NIS_SEC_CF_NA_KA -1
/* Is the NIS+ security conf file mech entry a real live GSS mech? */
sizeof (NIS_SEC_CF_DES_ALIAS) + 1) \
== 0))
#define VALID_GSS_MECH(m) ((m) != NULL)
/* valid keylen and algtype check */
#define VALID_KEYALG(k, a) ((k) != NIS_SEC_CF_NA_KA && \
(a) != NIS_SEC_CF_NA_KA)
#define VALID_ALIAS(a) ((a) != NULL)
/* Is the mech entry of the public key crypto variety? */
int __nis_translate_mechanism(const char *, int *, int *);
void __nis_release_mechanisms(mechanism_t **);
char *__nis_mechname2alias(const char *, char *, size_t);
char *__nis_authtype2mechalias(const char *, char *, size_t);
char *__nis_mechalias2authtype(const char *, char *, size_t);
/*
* NIS+ GSS Mech Dynamic Library Loading
*/
#define MAXDHNAME 64
const char *);
/*
* misc prototypes
*/
uint_t, int, int, char *, char *);
uint_t, int, int, char *, char *);
int __nis_gssprin2netname(rpc_gss_principal_t, char []);
void des_setparity_g(des_block *);
const char *);
int *);
keynum_t);
int key_removesecret_g(void);
int key_setnet_g(const char *, const char *, keylen_t, const char *,
char **, bool_t);
bool_t);
#ifdef __cplusplus
}
#endif
#endif /* !_NIS_DHEXT_H */