/*
* 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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "mt.h"
#include <stdlib.h>
#include <mp.h>
#include <rpc/key_prot.h>
#include <rpcsvc/nis_dhext.h>
#include <thread.h>
extern long random();
extern void des_setparity(char *);
static void adjust();
void __gen_dhkeys();
/*
* symbol names for the entry points into the Diffie-Hellman
* GSS mech backend routines
*/
/*
* Generate a seed
*/
static void
char *seed;
int seedsize;
unsigned char *pass;
{
int i;
int rseed;
for (i = 0; i < 8; i++) {
}
for (i = 0; i < seedsize; i++) {
}
}
/*
* Adjust the input key so that it is 0-filled on the left
*/
static void
char *keyin;
{
char *p;
char *s;
for (p = keyin; *p; p++)
;
*s = *p;
}
while (s >= keyout) {
*s-- = '0';
}
}
/*
* generate a Diffie-Hellman key-pair based on the given password.
* public and secret are buffers of size HEXKEYBYTES + 1.
*/
void
char *public;
char *secret;
char *pass;
{
int i;
unsigned short r;
char *xkey;
/* multiply base by 2 to get BASE */
}
}
/*
* Generic key size Diffie-Hellman key pair generation routine. For classic
* AUTH_DES, just call the current routine to handle it. Else, call the
* one in the appro GSS mech backend.
*
*/
int
char *skey, /* out */
char *pass) /* in */
{
return (0);
if (classic_des) {
return (1);
} else {
int (*dlfp)(); /* func ptr to dynamic loaded lib */
dl_gen_funcname)) {
return (1);
}
}
return (0);
}
/*
* Choose middle 64 bits of the common key to use as our des key, possibly
* overwriting the lower order bits by setting parity.
*
*/
int
{
MINT *a;
short r;
int i;
char *k;
a = mp_itom(0);
}
k = deskey->c;
for (i = 0; i < 8; i++) {
*k++ = r;
}
mp_mfree(a);
des_setparity((char *)deskey);
return (0);
}
/*
* Set the modulus for all our 192bit (algtype=0) Diffie-Hellman operations
*/
static void
setmodulus_192_0(void)
{
(void) mutex_lock(&mod_192_0_lck);
if (first_time) {
first_time = FALSE;
}
(void) mutex_unlock(&mod_192_0_lck);
}
/*
* Generic key size Diffie-Hellman common key generation routine.
* For classic AUTH_DES, do it inline like it's already done in several
* places (keyserv being one place). For new long key sizes,
* call the appro GSS mech backend routine.
*
* Arg 'keynum' is the size of the 'deskeys' array. It should be a 1
* classic AUTH_DES and a 3 for new long DH keys.
*
* Returns 1 on success and 0 on err.
*/
int
char *xsecret, /* in */
{
return (0);
if (classic_des) {
return (1);
} else {
int (*dlfp)(); /* func ptr to dynamically loaded lib */
/* function called will have void return value */
return (1);
}
}
return (0);
}