/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
+#include <afs/stds.h>
+
+#include <roken.h>
+#include <afs/opr.h>
#ifdef IGNORE_SOME_GCC_WARNINGS
# pragma GCC diagnostic warning "-Wstrict-prototypes"
# pragma GCC diagnostic warning "-Wimplicit-function-declaration"
#endif
+#include <hcrypto/des.h>
+
#define UBIK_LEGACY_CALLITER 1
-#include <afs/stds.h>
#include <afs/pthread_glock.h>
-#include <sys/types.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
-#include <sys/socket.h>
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#include <string.h>
-#include <stdio.h>
-#include <des.h>
-#include <des_prototypes.h>
#include <rx/rxkad.h>
+#include <rx/rxkad_convert.h>
#include <afs/cellconfig.h>
#include <ubik.h>
#include <afs/auth.h>
#include <afs/afsutil.h>
+
#include "kauth.h"
#include "kautils.h"
#ifdef ENCRYPTIONBLOCKSIZE
#undef ENCRYPTIONBLOCKSIZE
#endif
-#define ENCRYPTIONBLOCKSIZE (sizeof(des_cblock))
+#define ENCRYPTIONBLOCKSIZE (sizeof(DES_cblock))
/* Copy the specified list of servers into a specially know cell named
"explicit". The cell can then be used to debug experimental servers. */
void
-ka_ExplicitCell(char *cell, afs_int32 serverList[])
+ka_ExplicitCell(char *cell, afs_uint32 serverList[])
{
int i;
char cellname[MAXKTCREALMLEN];
LOCK_GLOBAL_MUTEX;
- if (cell && !strlen(cell))
- cell = 0;
+ if (cell == NULL || strlen(cell) == 0)
+ cell = NULL;
else
cell = lcstring(cellname, cell, sizeof(cellname));
afs_int32 * pwexpires)
{
struct ka_ticketAnswer *answer;
- afs_uint32 cksum;
unsigned char tempc;
answer = (struct ka_ticketAnswer *)oanswer->SeqBody;
- cksum = ntohl(answer->cksum);
if (challenge != ntohl(answer->challenge))
return KABADPROTOCOL;
memcpy(&token->sessionKey, &answer->sessionKey,
struct ktc_token * token, afs_int32 * pwexpires)
{ /* days until it expires */
afs_int32 code;
- des_key_schedule schedule;
+ DES_key_schedule schedule;
Date request_time;
struct ka_gettgtRequest request;
struct ka_gettgtAnswer answer_old;
int version;
LOCK_GLOBAL_MUTEX;
- if ((code = des_key_sched(ktc_to_cblock(key), schedule))) {
+ if ((code = DES_key_sched(ktc_to_cblock(key), &schedule))) {
UNLOCK_GLOBAL_MUTEX;
return KABADKEY;
}
memcpy(request.label, req_label, sizeof(request.label));
arequest.SeqLen = sizeof(request);
arequest.SeqBody = (char *)&request;
- des_pcbc_encrypt(arequest.SeqBody, arequest.SeqBody, arequest.SeqLen,
- schedule, ktc_to_cblockptr(key), ENCRYPT);
+ DES_pcbc_encrypt(arequest.SeqBody, arequest.SeqBody, arequest.SeqLen,
+ &schedule, ktc_to_cblockptr(key), ENCRYPT);
oanswer.MaxSeqLen = sizeof(answer);
oanswer.SeqLen = 0;
return code;
return KAUBIKCALL;
}
- des_pcbc_encrypt(oanswer.SeqBody, oanswer.SeqBody, oanswer.SeqLen,
- schedule, ktc_to_cblockptr(key), DECRYPT);
+ DES_pcbc_encrypt(oanswer.SeqBody, oanswer.SeqBody, oanswer.SeqLen,
+ &schedule, ktc_to_cblockptr(key), DECRYPT);
switch (version) {
case 1:
ka_BBS oanswer;
char *strings;
int len;
- des_key_schedule schedule;
+ DES_key_schedule schedule;
int version;
afs_int32 pwexpires;
aticket.SeqLen = auth_token->ticketLen;
aticket.SeqBody = auth_token->ticket;
- code = des_key_sched(ktc_to_cblock(&auth_token->sessionKey), schedule);
+ code = DES_key_sched(ktc_to_cblock(&auth_token->sessionKey), &schedule);
if (code) {
UNLOCK_GLOBAL_MUTEX;
return KABADKEY;
times.start = htonl(start);
times.end = htonl(end);
- des_ecb_encrypt(×, ×, schedule, ENCRYPT);
+ DES_ecb_encrypt((DES_cblock *)×, (DES_cblock *)×, &schedule,
+ ENCRYPT);
atimes.SeqLen = sizeof(times);
atimes.SeqBody = (char *)×
return KAUBIKCALL;
}
- des_pcbc_encrypt(oanswer.SeqBody, oanswer.SeqBody, oanswer.SeqLen,
- schedule, ktc_to_cblockptr(&auth_token->sessionKey), DECRYPT);
+ DES_pcbc_encrypt(oanswer.SeqBody, oanswer.SeqBody, oanswer.SeqLen,
+ &schedule, ktc_to_cblockptr(&auth_token->sessionKey),
+ DECRYPT);
switch (version) {
case 1:
afs_int32 code;
LOCK_GLOBAL_MUTEX;
-#if defined(AFS_S390_LINUX20_ENV) && !defined(AFS_S390X_LINUX20_ENV)
- code =
- ubik_KAM_SetPassword(conn, UBIK_CALL_NEW, name, instance, 0, 0, *(EncryptionKey *)newkey);
-#else
code =
ubik_KAM_SetPassword(conn, UBIK_CALL_NEW, name, instance, 0, *(EncryptionKey *)newkey);
-#endif
UNLOCK_GLOBAL_MUTEX;
return code;
}