[BACK]Return to umac.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/umac.c between version 1.11 and 1.12

version 1.11, 2014/07/22 07:13:42 version 1.12, 2017/05/31 08:09:45
Line 197 
Line 197 
         aes_encryption(in_buf, out_buf, key);          aes_encryption(in_buf, out_buf, key);
         memcpy(dst_buf,out_buf,nbytes);          memcpy(dst_buf,out_buf,nbytes);
     }      }
       explicit_bzero(in_buf, sizeof(in_buf));
       explicit_bzero(out_buf, sizeof(out_buf));
 }  }
   
 /* The final UHASH result is XOR'd with the output of a pseudorandom  /* The final UHASH result is XOR'd with the output of a pseudorandom
Line 221 
Line 223 
     /* Initialize pdf and cache */      /* Initialize pdf and cache */
     memset(pc->nonce, 0, sizeof(pc->nonce));      memset(pc->nonce, 0, sizeof(pc->nonce));
     aes_encryption(pc->nonce, pc->cache, pc->prf_key);      aes_encryption(pc->nonce, pc->cache, pc->prf_key);
       explicit_bzero(buf, sizeof(buf));
 }  }
   
 static void pdf_gen_xor(pdf_ctx *pc, const UINT8 nonce[8], UINT8 buf[8])  static void pdf_gen_xor(pdf_ctx *pc, const UINT8 nonce[8], UINT8 buf[8])
Line 539 
Line 542 
   
 /* ---------------------------------------------------------------------- */  /* ---------------------------------------------------------------------- */
   
   #if (__LITTLE_ENDIAN__)
 static void endian_convert(void *buf, UWORD bpw, UINT32 num_bytes)  static void endian_convert(void *buf, UWORD bpw, UINT32 num_bytes)
 /* We endian convert the keys on little-endian computers to               */  /* We endian convert the keys on little-endian computers to               */
 /* compensate for the lack of big-endian memory reads during hashing.     */  /* compensate for the lack of big-endian memory reads during hashing.     */
Line 561 
Line 565 
         } while (--iters);          } while (--iters);
     }      }
 }  }
 #if (__LITTLE_ENDIAN__)  
 #define endian_convert_if_le(x,y,z) endian_convert((x),(y),(z))  #define endian_convert_if_le(x,y,z) endian_convert((x),(y),(z))
 #else  #else
 #define endian_convert_if_le(x,y,z) do{}while(0)  /* Do nothing */  #define endian_convert_if_le(x,y,z) do{}while(0)  /* Do nothing */
Line 985 
Line 988 
     kdf(ahc->ip_trans, prf_key, 4, STREAMS * sizeof(UINT32));      kdf(ahc->ip_trans, prf_key, 4, STREAMS * sizeof(UINT32));
     endian_convert_if_le(ahc->ip_trans, sizeof(UINT32),      endian_convert_if_le(ahc->ip_trans, sizeof(UINT32),
                          STREAMS * sizeof(UINT32));                           STREAMS * sizeof(UINT32));
       explicit_bzero(buf, sizeof(buf));
 }  }
   
 /* ---------------------------------------------------------------------- */  /* ---------------------------------------------------------------------- */
Line 1194 
Line 1198 
     if (ctx) {      if (ctx) {
         if (ALLOC_BOUNDARY)          if (ALLOC_BOUNDARY)
             ctx = (struct umac_ctx *)ctx->free_ptr;              ctx = (struct umac_ctx *)ctx->free_ptr;
           explicit_bzero(ctx, sizeof(*ctx) + ALLOC_BOUNDARY);
         free(ctx);          free(ctx);
     }      }
     return (1);      return (1);
Line 1221 
Line 1226 
         aes_key_setup(key, prf_key);          aes_key_setup(key, prf_key);
         pdf_init(&ctx->pdf, prf_key);          pdf_init(&ctx->pdf, prf_key);
         uhash_init(&ctx->hash, prf_key);          uhash_init(&ctx->hash, prf_key);
           explicit_bzero(prf_key, sizeof(prf_key));
     }      }
   
     return (ctx);      return (ctx);

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12