#define INCLUDE_RXKAD_PRIVATE_DECLS
-RCSID
- ("$Header$");
#ifdef KERNEL
#ifndef UKERNEL
#else /* KERNEL */
#include <afs/stds.h>
#include <sys/types.h>
+#include <string.h>
#include <time.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
#endif
#include <rx/rx.h>
#include <rx/xdr.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
#include <afs/afsutil.h>
#endif /* KERNEL */
assert((head) && ((head)->prev == NULL)); \
} while(0)
-void rxkad_global_stats_init() {
+void rxkad_global_stats_init(void) {
assert(pthread_mutex_init(&rxkad_global_stats_lock, (const pthread_mutexattr_t *)0) == 0);
assert(pthread_key_create(&rxkad_stats_key, NULL) == 0);
memset(&rxkad_global_stats, 0, sizeof(rxkad_global_stats));
}
rxkad_stats_t *
-rxkad_thr_stats_init() {
+rxkad_thr_stats_init(void) {
rxkad_stats_t * rxkad_stats;
rxkad_stats = (rxkad_stats_t *)malloc(sizeof(rxkad_stats_t));
assert(rxkad_stats != NULL && pthread_setspecific(rxkad_stats_key,rxkad_stats) == 0);
rxkad_stats->des_encrypts[1] += thr_stats->des_encrypts[1];
rxkad_stats->des_key_scheds += thr_stats->des_key_scheds;
rxkad_stats->des_randoms += thr_stats->des_randoms;
+ rxkad_stats->clientObjects += thr_stats->clientObjects;
+ rxkad_stats->serverObjects += thr_stats->serverObjects;
rxkad_stats->spares[0] += thr_stats->spares[0];
rxkad_stats->spares[1] += thr_stats->spares[1];
rxkad_stats->spares[2] += thr_stats->spares[2];
rxkad_stats->spares[5] += thr_stats->spares[5];
rxkad_stats->spares[6] += thr_stats->spares[6];
rxkad_stats->spares[7] += thr_stats->spares[7];
- rxkad_stats->spares[8] += thr_stats->spares[8];
- rxkad_stats->spares[9] += thr_stats->spares[9];
}
RXKAD_GLOBAL_STATS_UNLOCK;
return 0;
rxkad_SetupEndpoint(aconnp, &tendpoint);
memcpy((void *)xor, aivec, 2 * sizeof(afs_int32));
- fc_cbc_encrypt(&tendpoint, &tendpoint, sizeof(tendpoint), aschedule, xor,
+ fc_cbc_encrypt(&tendpoint, &tendpoint, sizeof(tendpoint), *aschedule, xor,
ENCRYPT);
memcpy(aresult,
((char *)&tendpoint) + sizeof(tendpoint) - ENCRYPTIONBLOCKSIZE,
word[0] ^= aivec[0];
word[1] ^= aivec[1];
/* encrypts word as if it were a character string */
- fc_ecb_encrypt(word, word, aschedule, ENCRYPT);
+ fc_ecb_encrypt(word, word, *aschedule, ENCRYPT);
t = ntohl(word[1]);
t = (t >> 16) & 0xffff;
if (t == 0)
return RXKADINCONSISTENCY;
rxkad_SetLevel(aconn, tcp->level); /* set header and trailer sizes */
rxkad_AllocCID(aobj, aconn); /* CHANGES cid AND epoch!!!! */
- rxkad_DeriveXORInfo(aconn, tcp->keysched, tcp->ivec, tccp->preSeq);
+ rxkad_DeriveXORInfo(aconn, (fc_KeySchedule *)tcp->keysched, (char *)tcp->ivec, (char *)tccp->preSeq);
INC_RXKAD_STATS(connections[rxkad_LevelIndex(tcp->level)]);
}
{
struct rx_connection *tconn;
rxkad_level level;
- fc_KeySchedule *schedule;
+ const fc_KeySchedule *schedule;
fc_InitializationVector *ivec;
int len;
int nlen = 0;
INC_RXKAD_STATS(checkPackets[rxkad_StatIndex(rxkad_server, level)]);
sconn->stats.packetsReceived++;
sconn->stats.bytesReceived += len;
- schedule = (fc_KeySchedule *) sconn->keysched;
+ schedule = (const fc_KeySchedule *) sconn->keysched;
ivec = (fc_InitializationVector *) sconn->ivec;
} else {
INC_RXKAD_STATS(expired);
cconn->stats.packetsReceived++;
cconn->stats.bytesReceived += len;
preSeq = cconn->preSeq;
- schedule = (fc_KeySchedule *) tcp->keysched;
+ schedule = (const fc_KeySchedule *) tcp->keysched;
ivec = (fc_InitializationVector *) tcp->ivec;
}
if (checkCksum) {
- code = ComputeSum(apacket, schedule, preSeq);
+ code = ComputeSum(apacket, (fc_KeySchedule *)schedule, preSeq);
if (code != rx_GetPacketCksum(apacket))
return RXKADSEALEDINCON;
}
return 0; /* shouldn't happen */
case rxkad_auth:
rx_Pullup(apacket, 8); /* the following encrypts 8 bytes only */
- fc_ecb_encrypt(rx_DataOf(apacket), rx_DataOf(apacket), schedule,
+ fc_ecb_encrypt(rx_DataOf(apacket), rx_DataOf(apacket), *schedule,
DECRYPT);
break;
case rxkad_crypt:
- code = rxkad_DecryptPacket(tconn, schedule, ivec, len, apacket);
+ code = rxkad_DecryptPacket(tconn, schedule, (const fc_InitializationVector *)ivec, len, apacket);
if (code)
return code;
break;
nlen - (len + rx_GetSecurityHeaderSize(tconn)));
}
rx_Pullup(apacket, 8); /* the following encrypts 8 bytes only */
- fc_ecb_encrypt(rx_DataOf(apacket), rx_DataOf(apacket), schedule,
+ fc_ecb_encrypt(rx_DataOf(apacket), rx_DataOf(apacket), *schedule,
ENCRYPT);
break;
case rxkad_crypt:
rxi_RoundUpPacket(apacket,
nlen - (len + rx_GetSecurityHeaderSize(tconn)));
}
- code = rxkad_EncryptPacket(tconn, schedule, ivec, nlen, apacket);
+ code = rxkad_EncryptPacket(tconn, (const fc_KeySchedule *)schedule, (const fc_InitializationVector *)ivec, nlen, apacket);
if (code)
return code;
break;