diff options
Diffstat (limited to 'fs/ecryptfs/crypto.c')
-rw-r--r-- | fs/ecryptfs/crypto.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index cbadc1bee6e7..bfd8b680e648 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -348,7 +348,7 @@ static int encrypt_scatterlist(struct ecryptfs_crypt_stat *crypt_stat, | |||
348 | BUG_ON(!crypt_stat || !crypt_stat->tfm | 348 | BUG_ON(!crypt_stat || !crypt_stat->tfm |
349 | || !(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED)); | 349 | || !(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED)); |
350 | if (unlikely(ecryptfs_verbosity > 0)) { | 350 | if (unlikely(ecryptfs_verbosity > 0)) { |
351 | ecryptfs_printk(KERN_DEBUG, "Key size [%d]; key:\n", | 351 | ecryptfs_printk(KERN_DEBUG, "Key size [%zd]; key:\n", |
352 | crypt_stat->key_size); | 352 | crypt_stat->key_size); |
353 | ecryptfs_dump_hex(crypt_stat->key, | 353 | ecryptfs_dump_hex(crypt_stat->key, |
354 | crypt_stat->key_size); | 354 | crypt_stat->key_size); |
@@ -413,10 +413,9 @@ static int ecryptfs_encrypt_extent(struct page *enc_extent_page, | |||
413 | rc = ecryptfs_derive_iv(extent_iv, crypt_stat, | 413 | rc = ecryptfs_derive_iv(extent_iv, crypt_stat, |
414 | (extent_base + extent_offset)); | 414 | (extent_base + extent_offset)); |
415 | if (rc) { | 415 | if (rc) { |
416 | ecryptfs_printk(KERN_ERR, "Error attempting to " | 416 | ecryptfs_printk(KERN_ERR, "Error attempting to derive IV for " |
417 | "derive IV for extent [0x%.16x]; " | 417 | "extent [0x%.16llx]; rc = [%d]\n", |
418 | "rc = [%d]\n", (extent_base + extent_offset), | 418 | (unsigned long long)(extent_base + extent_offset), rc); |
419 | rc); | ||
420 | goto out; | 419 | goto out; |
421 | } | 420 | } |
422 | if (unlikely(ecryptfs_verbosity > 0)) { | 421 | if (unlikely(ecryptfs_verbosity > 0)) { |
@@ -443,9 +442,9 @@ static int ecryptfs_encrypt_extent(struct page *enc_extent_page, | |||
443 | } | 442 | } |
444 | rc = 0; | 443 | rc = 0; |
445 | if (unlikely(ecryptfs_verbosity > 0)) { | 444 | if (unlikely(ecryptfs_verbosity > 0)) { |
446 | ecryptfs_printk(KERN_DEBUG, "Encrypt extent [0x%.16x]; " | 445 | ecryptfs_printk(KERN_DEBUG, "Encrypt extent [0x%.16llx]; " |
447 | "rc = [%d]\n", (extent_base + extent_offset), | 446 | "rc = [%d]\n", |
448 | rc); | 447 | (unsigned long long)(extent_base + extent_offset), rc); |
449 | ecryptfs_printk(KERN_DEBUG, "First 8 bytes after " | 448 | ecryptfs_printk(KERN_DEBUG, "First 8 bytes after " |
450 | "encryption:\n"); | 449 | "encryption:\n"); |
451 | ecryptfs_dump_hex((char *)(page_address(enc_extent_page)), 8); | 450 | ecryptfs_dump_hex((char *)(page_address(enc_extent_page)), 8); |
@@ -540,10 +539,9 @@ static int ecryptfs_decrypt_extent(struct page *page, | |||
540 | rc = ecryptfs_derive_iv(extent_iv, crypt_stat, | 539 | rc = ecryptfs_derive_iv(extent_iv, crypt_stat, |
541 | (extent_base + extent_offset)); | 540 | (extent_base + extent_offset)); |
542 | if (rc) { | 541 | if (rc) { |
543 | ecryptfs_printk(KERN_ERR, "Error attempting to " | 542 | ecryptfs_printk(KERN_ERR, "Error attempting to derive IV for " |
544 | "derive IV for extent [0x%.16x]; " | 543 | "extent [0x%.16llx]; rc = [%d]\n", |
545 | "rc = [%d]\n", (extent_base + extent_offset), | 544 | (unsigned long long)(extent_base + extent_offset), rc); |
546 | rc); | ||
547 | goto out; | 545 | goto out; |
548 | } | 546 | } |
549 | if (unlikely(ecryptfs_verbosity > 0)) { | 547 | if (unlikely(ecryptfs_verbosity > 0)) { |
@@ -571,9 +569,9 @@ static int ecryptfs_decrypt_extent(struct page *page, | |||
571 | } | 569 | } |
572 | rc = 0; | 570 | rc = 0; |
573 | if (unlikely(ecryptfs_verbosity > 0)) { | 571 | if (unlikely(ecryptfs_verbosity > 0)) { |
574 | ecryptfs_printk(KERN_DEBUG, "Decrypt extent [0x%.16x]; " | 572 | ecryptfs_printk(KERN_DEBUG, "Decrypt extent [0x%.16llx]; " |
575 | "rc = [%d]\n", (extent_base + extent_offset), | 573 | "rc = [%d]\n", |
576 | rc); | 574 | (unsigned long long)(extent_base + extent_offset), rc); |
577 | ecryptfs_printk(KERN_DEBUG, "First 8 bytes after " | 575 | ecryptfs_printk(KERN_DEBUG, "First 8 bytes after " |
578 | "decryption:\n"); | 576 | "decryption:\n"); |
579 | ecryptfs_dump_hex((char *)(page_address(page) | 577 | ecryptfs_dump_hex((char *)(page_address(page) |
@@ -780,7 +778,7 @@ int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat) | |||
780 | } | 778 | } |
781 | ecryptfs_printk(KERN_DEBUG, | 779 | ecryptfs_printk(KERN_DEBUG, |
782 | "Initializing cipher [%s]; strlen = [%d]; " | 780 | "Initializing cipher [%s]; strlen = [%d]; " |
783 | "key_size_bits = [%d]\n", | 781 | "key_size_bits = [%zd]\n", |
784 | crypt_stat->cipher, (int)strlen(crypt_stat->cipher), | 782 | crypt_stat->cipher, (int)strlen(crypt_stat->cipher), |
785 | crypt_stat->key_size << 3); | 783 | crypt_stat->key_size << 3); |
786 | if (crypt_stat->tfm) { | 784 | if (crypt_stat->tfm) { |