$(UOBJ)/Kvice.xdr.o \
$(UOBJ)/xdr_arrayn.o \
$(UOBJ)/Kvice.cs.o \
- $(UOBJ)/fcrypt.o \
+ $(UOBJ)/bg-fcrypt.o \
$(UOBJ)/rx.o \
$(UOBJ)/rx_rdwr.o \
$(UOBJ)/rx_clock.o \
$(UOBJ)/Kvldbint.cs.o \
$(UOBJ)/Kvldbint.xdr.o \
$(UOBJ)/Kcallback.ss.o \
- $(UOBJ)/crypt_conn.o \
$(UOBJ)/AFS_component_version_number.o \
$(UOBJ)/afs_exporter.o \
$(UOBJ)/rxkad_client.o \
$(WEBOBJ)/Kvice.xdr.o \
$(WEBOBJ)/xdr_arrayn.o \
$(WEBOBJ)/Kvice.cs.o \
- $(WEBOBJ)/fcrypt.o \
+ $(WEBOBJ)/bg-fcrypt.o \
$(WEBOBJ)/rx.o \
$(WEBOBJ)/rx_rdwr.o \
$(WEBOBJ)/rx_clock.o \
$(WEBOBJ)/Kvldbint.cs.o \
$(WEBOBJ)/Kvldbint.xdr.o \
$(WEBOBJ)/Kcallback.ss.o \
- $(WEBOBJ)/crypt_conn.o \
$(WEBOBJ)/AFS_component_version_number.o \
$(WEBOBJ)/afs_exporter.o \
$(WEBOBJ)/rxkad_client.o \
$(WEBOBJ)/Kvice.xdr.o \
$(WEBOBJ)/xdr_arrayn.o \
$(WEBOBJ)/Kvice.cs.o \
- $(WEBOBJ)/fcrypt.o \
+ $(WEBOBJ)/bg-fcrypt.o \
$(WEBOBJ)/rx.o \
$(WEBOBJ)/rx_rdwr.o \
$(WEBOBJ)/rx_clock.o \
$(WEBOBJ)/Kvldbint.cs.o \
$(WEBOBJ)/Kvldbint.xdr.o \
$(WEBOBJ)/Kcallback.ss.o \
- $(WEBOBJ)/crypt_conn.o \
$(WEBOBJ)/AFS_component_version_number.o \
$(WEBOBJ)/afs_exporter.o \
$(WEBOBJ)/rxkad_client.o \
$(CRULE1);
$(UOBJ)/afs_stat.o: $(AFS)/afs_stat.c
$(CRULE1);
-$(UOBJ)/fcrypt.o: $(AFS)/fcrypt.c
- $(CRULE1);
-$(UOBJ)/crypt_conn.o: $(AFS)/crypt_conn.c
+$(UOBJ)/bg-fcrypt.o: $(AFS)/bg-fcrypt.c
$(CRULE1);
$(UOBJ)/rxkad_client.o: $(AFS)/rxkad_client.c
$(CRULE1);
$(CRULE2);
$(WEBOBJ)/afs_stat.o: $(AFS)/afs_stat.c
$(CRULE2);
-$(WEBOBJ)/fcrypt.o: $(AFS)/fcrypt.c
- $(CRULE2);
-$(WEBOBJ)/crypt_conn.o: $(AFS)/crypt_conn.c
+$(WEBOBJ)/bg-fcrypt.o: $(AFS)/bg-fcrypt.c
$(CRULE2);
$(WEBOBJ)/rxkad_client.o: $(AFS)/rxkad_client.c
$(CRULE2);
*/
#include <afsconfig.h>
#ifdef KERNEL
-#include "afs/param.h"
+#include "../afs/param.h"
#else
#include <afs/param.h>
#endif
#define DEBUG 0
#ifdef KERNEL
#ifndef UKERNEL
-#include "afs/stds.h"
-#include "h/types.h"
+#include "../afs/stds.h"
+#include "../h/types.h"
#if !defined(AFS_LINUX20_ENV) && !defined(AFS_OBSD_ENV)
-#include "netinet/in.h"
+#include "../netinet/in.h"
#endif
#else /* UKERNEL */
-#include "afs/sysincludes.h"
-#include "afs/stds.h"
+#include "../afs/sysincludes.h"
+#include "../afs/stds.h"
#endif /* UKERNEL */
#ifdef AFS_LINUX22_ENV
#include <asm/byteorder.h>
#endif
-#include "afs/longc_procs.h"
-
+#include "../afs/longc_procs.h"
+#include "../rx/rx.h"
#else /* KERNEL */
#include <afs/stds.h>
#include "fcrypt.h"
#include "rxkad.h"
#include "fcrypt.h"
+#include "private_data.h"
#undef WORDS_BIGENDIAN
#ifdef AFSBIG_ENDIAN
*/
#define F_ENCRYPT(R, L, sched) { \
- union lc4 { afs_uint32 l; unsigned char c[4]; } u; \
- u.l = sched ^ R; \
- L ^= sbox0[u.c[0]] ^ sbox1[u.c[1]] ^ sbox2[u.c[2]] ^ sbox3[u.c[3]]; }
+ union lc4 { afs_uint32 l; unsigned char c[4]; } un; \
+ un.l = sched ^ R; \
+ L ^= sbox0[un.c[0]] ^ sbox1[un.c[1]] ^ sbox2[un.c[2]] ^ sbox3[un.c[3]]; }
#ifndef WORDS_BIGENDIAN
/* BEWARE: this code is endian dependent.
#undef F_ENCRYPT
#define FF(y, shiftN) (((y) >> shiftN) & 0xFF)
#define F_ENCRYPT(R, L, sched) { \
- afs_uint32 u; \
- u = sched ^ R; \
- L ^= sbox0[FF(u, 0)] ^ sbox1[FF(u, 8)] ^ sbox2[FF(u, 16)] ^ sbox3[FF(u, 24)];}
+ afs_uint32 un; \
+ un = sched ^ R; \
+ L ^= sbox0[FF(un, 0)] ^ sbox1[FF(un, 8)] ^ sbox2[FF(un, 16)] ^ sbox3[FF(un, 24)];}
#endif
static inline
fc_KeySchedule sched,
int encrypt)
{
- if (encrypt)
+ LOCK_RXKAD_STATS
+ rxkad_stats.fc_encrypts[encrypt]++;
+ UNLOCK_RXKAD_STATS
+ if (encrypt)
fc_ecb_enc(in[0], in[1], out, sched);
else
fc_ecb_dec(in[0], in[1], out, sched);
*sched++ = EFF_NTOHL((afs_uint32)k);
ROT56R64(k, 11);
*sched++ = EFF_NTOHL((afs_uint32)k);
- return 0;
#else
afs_uint32 hi, lo; /* hi is upper 24 bits and lo lower 32, total 56 */
*sched++ = EFF_NTOHL(lo);
ROT56R(hi, lo, 11);
*sched++ = EFF_NTOHL(lo);
- return 0;
#endif
+ LOCK_RXKAD_STATS
+ rxkad_stats.fc_key_scheds++;
+ UNLOCK_RXKAD_STATS
+ return 0;
}
/*
{
afs_uint32 ivec[2];
struct iovec *frag;
+ struct rx_securityClass *obj;
+ struct rxkad_cprivate *tp; /* s & c have type at same offset */
+
+ obj = rx_SecurityObjectOf(rx_connection_not_used);
+ tp = (struct rxkad_cprivate *)obj->privateData;
+ LOCK_RXKAD_STATS
+ rxkad_stats.bytesEncrypted[rxkad_TypeIndex(tp->type)] += len;
+ UNLOCK_RXKAD_STATS
{
/* What is this good for?
{
afs_uint32 ivec[2];
struct iovec *frag;
+ struct rx_securityClass *obj;
+ struct rxkad_cprivate *tp; /* s & c have type at same offset */
+
+ obj = rx_SecurityObjectOf(rx_connection_not_used);
+ tp = (struct rxkad_cprivate *)obj->privateData;
+ LOCK_RXKAD_STATS
+ rxkad_stats.bytesDecrypted[rxkad_TypeIndex(tp->type)] += len;
+ UNLOCK_RXKAD_STATS
memcpy(ivec, iv, sizeof(ivec)); /* Must use copy of iv */
for (frag = &packet->wirevec[1]; len > 0; frag++)