Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/common/crypto/modes/ccm.c
          +++ new/usr/src/common/crypto/modes/ccm.c
↓ open down ↓ 427 lines elided ↑ open up ↑
 428  428  
 429  429                  if (pt_part + ctx->ccm_remainder_len < block_size) {
 430  430                          /*
 431  431                           * since this is last of the ciphertext, will
 432  432                           * just decrypt with it here
 433  433                           */
 434  434                          bcopy(datap, &((uint8_t *)ctx->ccm_remainder)
 435  435                              [ctx->ccm_remainder_len], pt_part);
 436  436                          ctx->ccm_remainder_len += pt_part;
 437  437                          ccm_decrypt_incomplete_block(ctx, encrypt_block);
      438 +                        ctx->ccm_processed_data_len += ctx->ccm_remainder_len;
 438  439                          ctx->ccm_remainder_len = 0;
 439      -                        ctx->ccm_processed_data_len += pt_part;
 440  440                          return (CRYPTO_SUCCESS);
 441  441                  } else {
 442  442                          /* let rest of the code handle this */
 443  443                          length = pt_part;
 444  444                  }
 445  445          } else if (length + ctx->ccm_remainder_len < block_size) {
 446  446                          /* accumulate bytes here and return */
 447  447                  bcopy(datap,
 448  448                      (uint8_t *)ctx->ccm_remainder + ctx->ccm_remainder_len,
 449  449                      length);
↓ open down ↓ 487 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX