Eastrall / EntityFrameworkCore.DataEncryption

A plugin for Microsoft.EntityFrameworkCore to add support of encrypted fields using built-in or custom encryption providers.
MIT License
326 stars 54 forks source link

Decrypt: check for null values to avoid exception on Encoding.UTF8.GetString #56

Closed romangobrey closed 7 months ago

romangobrey commented 1 year ago

Fix: provider might return null (for decryptedRawBytes variable) when decrypting data which leads to an exception here

var decryptedData = Encoding.UTF8.GetString(decryptedRawBytes).Trim('\0');

codecov-commenter commented 1 year ago

Codecov Report

Merging #56 (fc504f9) into main (ea6836b) will not change coverage. The diff coverage is 100.00%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main      #56   +/-   ##
=======================================
  Coverage   94.44%   94.44%           
=======================================
  Files           6        6           
  Lines         144      144           
  Branches       30       30           
=======================================
  Hits          136      136           
  Misses          3        3           
  Partials        5        5           
Impacted Files Coverage Δ
...ore.DataEncryption/Internal/EncryptionConverter.cs 93.93% <100.00%> (ø)