2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License, Version 1.0 only
2N/A * (the "License"). You may not use this file except in compliance
2N/A * with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * dh_nsl_tmpl.c
2N/A *
2N/A * Copyright (c) 1997, by Sun Microsystems, Inc.
2N/A * All rights reserved.
2N/A */
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A/*
2N/A * Entry points for key generation for libnsl. This file should
2N/A * be included in the file that defines the MODULUS, ROOT, and KEYLEN
2N/A * for an algorithm 0 mechanism.
2N/A */
2N/A
2N/A
2N/A/*
2N/A * The libnsl routine __gen_common_dhkeys_g generate a set of DES
2N/A * keys based on the DH common key given the ALGTYPE and KEYLEN. That
2N/A * routine will construct the mechanism name from those inputs and
2N/A * dlopen the mechanism library to grab this routine with dlsym. This
2N/A * routine will then be used to generate the common key from the
2N/A * supplied public key, private key, and passwd. This routine is
2N/A * just a wrapper to call the generic algorithm 0 key generation
2N/A * routine found in generic_key.c with KEYLEN and MODULUS specified.
2N/A */
2N/A
2N/Avoid
2N/A__dl_gen_common_dhkeys(char *xpublic, char *xsecret,
2N/A des_block keys[], int keynum)
2N/A{
2N/A __generic_common_dhkeys(xpublic, xsecret, KEYLEN,
2N/A MODULUS, keys, keynum);
2N/A}
2N/A
2N/A/*
2N/A * The libnsl routine __gen_dhkeys_g generate a key pair for a given
2N/A * ALGTYPE and KEYLEN. That routine will construct the mechanism
2N/A * name from those inputs and dlopen the mechanism to grab this routine. It
2N/A * will then use this routine to generate the key pair. This routine
2N/A * is just a wrapper that marshels the MODULUS, ROOT, and KEYLEN to the
2N/A * generic algorithm 0 key generation routine found in generic_key.c
2N/A */
2N/A
2N/Avoid
2N/A__dl_gen_dhkeys(char *xpublic, char *xsecret, char *passwd)
2N/A{
2N/A __generic_gen_dhkeys(KEYLEN, MODULUS, ROOT, xpublic, xsecret, passwd);
2N/A}