diff options
author | Yi Kong <yikong@google.com> | 2018-07-30 15:53:23 -0700 |
---|---|---|
committer | Yi Kong <yikong@google.com> | 2018-07-30 15:54:04 -0700 |
commit | 3712b27403be88e4bd693e26c10a31724b5e19ce (patch) | |
tree | d749fe06b47eb3b49bbf12cf6590b28af3e5205f /key_blob_utils/ocb_utils.cpp | |
parent | a2040e8bcde6f0984321d62750aaa9b01024f534 (diff) | |
download | android_system_keymaster-3712b27403be88e4bd693e26c10a31724b5e19ce.tar.gz android_system_keymaster-3712b27403be88e4bd693e26c10a31724b5e19ce.tar.bz2 android_system_keymaster-3712b27403be88e4bd693e26c10a31724b5e19ce.zip |
Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.
Test: m
Bug: 68236239
Change-Id: Ieea37d3d09bfcc88603ea691dacd264f4066cfa7
Diffstat (limited to 'key_blob_utils/ocb_utils.cpp')
-rw-r--r-- | key_blob_utils/ocb_utils.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/key_blob_utils/ocb_utils.cpp b/key_blob_utils/ocb_utils.cpp index 7fe7ad9..409029c 100644 --- a/key_blob_utils/ocb_utils.cpp +++ b/key_blob_utils/ocb_utils.cpp @@ -33,7 +33,7 @@ namespace keymaster { class AeCtx { public: - AeCtx() : ctx_(ae_allocate(NULL)) {} + AeCtx() : ctx_(ae_allocate(nullptr)) {} ~AeCtx() { ae_clear(ctx_); ae_free(ctx_); @@ -138,7 +138,7 @@ keymaster_error_t OcbEncryptKey(const AuthorizationSet& hw_enforced, return KM_ERROR_MEMORY_ALLOCATION_FAILED; int ae_err = ae_encrypt(ctx.get(), nonce.peek_read(), plaintext.key_material, - plaintext.key_material_size, NULL /* additional data */, + plaintext.key_material_size, nullptr /* additional data */, 0 /* additional data length */, ciphertext->writable_data(), tag->peek_write(), 1 /* final */); if (ae_err < 0) { @@ -174,7 +174,7 @@ keymaster_error_t OcbDecryptKey(const AuthorizationSet& hw_enforced, return KM_ERROR_MEMORY_ALLOCATION_FAILED; int ae_err = ae_decrypt(ctx.get(), nonce.peek_read(), ciphertext.key_material, - ciphertext.key_material_size, NULL /* additional data */, + ciphertext.key_material_size, nullptr /* additional data */, 0 /* additional data length */, plaintext->writable_data(), tag.peek_read(), 1 /* final */); if (ae_err == AE_INVALID) { |