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

Diff for /src/usr.bin/ssh/cipher-chachapoly.c between version 1.3 and 1.4

version 1.3, 2013/12/15 21:42:35 version 1.4, 2014/01/31 16:39:19
Line 56 
Line 56 
          * Run ChaCha20 once to generate the Poly1305 key. The IV is the           * Run ChaCha20 once to generate the Poly1305 key. The IV is the
          * packet sequence number.           * packet sequence number.
          */           */
         bzero(poly_key, sizeof(poly_key));          memset(poly_key, 0, sizeof(poly_key));
         put_u64(seqbuf, seqnr);          put_u64(seqbuf, seqnr);
         chacha_ivsetup(&ctx->main_ctx, seqbuf, NULL);          chacha_ivsetup(&ctx->main_ctx, seqbuf, NULL);
         chacha_encrypt_bytes(&ctx->main_ctx,          chacha_encrypt_bytes(&ctx->main_ctx,
Line 88 
Line 88 
         r = 0;          r = 0;
   
  out:   out:
         bzero(expected_tag, sizeof(expected_tag));          explicit_bzero(expected_tag, sizeof(expected_tag));
         bzero(seqbuf, sizeof(seqbuf));          explicit_bzero(seqbuf, sizeof(seqbuf));
         bzero(poly_key, sizeof(poly_key));          explicit_bzero(poly_key, sizeof(poly_key));
         return r;          return r;
 }  }
   

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4