Add SecureBlob::HexStringToSecureBlob.

Polymorphic usage of SecureBlob is problematic (see
In some cases we're unnecessarily passing plain Blobs into functions
that take SecureBlobs because we don't have code to create a SecureBlob
from a hex string, so we use base::HexStringToBytes to create a Blob

This CL does attempt to use HexStringToBytes and then zero out the
memory. As long as we still have polymorphic usage of SecureBlobs,
this is not a big deal. Once we decouple SecureBlob from Blob, we can
improve this implementation.

TEST=New unit tests.

Change-Id: Iad94cbd8f574dd35730cb2d68b6ae39798b03ef6
Commit-Ready: Jorge Lucangeli Obes <>
Tested-by: Jorge Lucangeli Obes <>
Reviewed-by: Jorge Lucangeli Obes <>
3 files changed