fix-indent-bug-with-lock-macros-part-four-20040819
authorNickolai Zeldovich <kolya@mit.edu>
Thu, 19 Aug 2004 22:37:51 +0000 (22:37 +0000)
committerNickolai Zeldovich <kolya@mit.edu>
Thu, 19 Aug 2004 22:37:51 +0000 (22:37 +0000)
Thanks to jaltman for pointing out some files I missed
(basically those in two-level deep directories).

src/rxkad/domestic/crypt_conn.c
src/rxkad/domestic/fcrypt.c

index cfabc8b..67970e0 100644 (file)
@@ -61,9 +61,10 @@ rxkad_DecryptPacket(const struct rx_connection *conn,
 
     obj = rx_SecurityObjectOf(conn);
     tp = (struct rxkad_cprivate *)obj->privateData;
-    LOCK_RXKAD_STATS rxkad_stats.bytesDecrypted[rxkad_TypeIndex(tp->type)] +=
-       len;
-    UNLOCK_RXKAD_STATS memcpy((void *)xor, (void *)ivec, sizeof(xor));
+    LOCK_RXKAD_STATS;
+    rxkad_stats.bytesDecrypted[rxkad_TypeIndex(tp->type)] += len;
+    UNLOCK_RXKAD_STATS;
+    memcpy((void *)xor, (void *)ivec, sizeof(xor));
     for (i = 0; len; i++) {
        data = rx_data(packet, i, tlen);
        if (!data || !tlen)
@@ -96,15 +97,15 @@ rxkad_EncryptPacket(const struct rx_connection * conn,
 
     obj = rx_SecurityObjectOf(conn);
     tp = (struct rxkad_cprivate *)obj->privateData;
-    LOCK_RXKAD_STATS rxkad_stats.bytesEncrypted[rxkad_TypeIndex(tp->type)] +=
-       len;
-    UNLOCK_RXKAD_STATS
-       /*
-        * afs_int32 cksum;
-        * cksum = htonl(0);                
-        * * Future option to add cksum here, but for now we just put 0
-        */
-       rx_PutInt32(packet, 1 * sizeof(afs_int32), 0);
+    LOCK_RXKAD_STATS;
+    rxkad_stats.bytesEncrypted[rxkad_TypeIndex(tp->type)] += len;
+    UNLOCK_RXKAD_STATS;
+    /*
+     * afs_int32 cksum;
+     * cksum = htonl(0);                
+     * * Future option to add cksum here, but for now we just put 0
+     */
+    rx_PutInt32(packet, 1 * sizeof(afs_int32), 0);
 
     memcpy((void *)xor, (void *)ivec, sizeof(xor));
     for (i = 0; len; i++) {
index 2eaba12..b395f79 100644 (file)
@@ -102,8 +102,10 @@ fc_keysched(struct ktc_encryptionKey *key, fc_KeySchedule schedule)
        kword[1] = (kword[1] >> 11) | (temp << (56 - 32 - 11));
        schedule[i] = kword[0];
     }
-    LOCK_RXKAD_STATS rxkad_stats.fc_key_scheds++;
-    UNLOCK_RXKAD_STATS return 0;
+    LOCK_RXKAD_STATS;
+    rxkad_stats.fc_key_scheds++;
+    UNLOCK_RXKAD_STATS;
+    return 0;
 }
 
 /* IN int encrypt; * 0 ==> decrypt, else encrypt */
@@ -138,8 +140,10 @@ fc_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
 #endif
 
     if (encrypt) {
-       LOCK_RXKAD_STATS rxkad_stats.fc_encrypts[ENCRYPT]++;
-       UNLOCK_RXKAD_STATS for (i = 0; i < (ROUNDS / 2); i++) {
+       LOCK_RXKAD_STATS;
+       rxkad_stats.fc_encrypts[ENCRYPT]++;
+       UNLOCK_RXKAD_STATS;
+       for (i = 0; i < (ROUNDS / 2); i++) {
            S = *schedule++ ^ R;        /* xor R with key bits from schedule */
            Pchar[Byte2] = sbox0[Schar[Byte0]]; /* do 8-bit S Box subst. */
            Pchar[Byte3] = sbox1[Schar[Byte1]]; /* and permute the result */
@@ -156,8 +160,10 @@ fc_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
            R ^= P;
        }
     } else {
-       LOCK_RXKAD_STATS rxkad_stats.fc_encrypts[DECRYPT]++;
-       UNLOCK_RXKAD_STATS schedule = &schedule[ROUNDS - 1];    /* start at end of key schedule */
+       LOCK_RXKAD_STATS;
+       rxkad_stats.fc_encrypts[DECRYPT]++;
+       UNLOCK_RXKAD_STATS;
+       schedule = &schedule[ROUNDS - 1];       /* start at end of key schedule */
        for (i = 0; i < (ROUNDS / 2); i++) {
            S = *schedule-- ^ L;        /* xor R with key bits from schedule */
            Pchar[Byte2] = sbox0[Schar[Byte0]]; /* do 8-bit S Box subst. and */