Lines Matching refs:blob
26 #include "blob.h"
116 ALOGD("Failed to decrypt blob; ciphertext or tag is likely corrupted");
133 Blob::Blob(const uint8_t* value, size_t valueLength, const uint8_t* info, uint8_t infoLength,
138 ALOGW("Provided blob length too large");
160 Blob::Blob(blobv3 b) {
164 Blob::Blob() {
168 bool Blob::isEncrypted() const {
176 bool Blob::isSuperEncrypted() const {
180 bool Blob::isCriticalToDeviceEncryption() const {
188 void Blob::setEncrypted(bool encrypted) {
192 void Blob::setSuperEncrypted(bool superEncrypted) {
196 void Blob::setCriticalToDeviceEncryption(bool critical) {
200 void Blob::setFallback(bool fallback) {
208 ResponseCode Blob::writeBlob(const std::string& filename, const uint8_t* aes_key, State state,
210 ALOGV("writing blob %s", filename.c_str());
217 ALOGD("couldn't insert encrypted blob while not unlocked");
247 ALOGW("blob not fully written %zu != %zu", writtenBytes, fileLength);
252 ALOGW("could not rename blob to %s: %s", filename.c_str(), strerror(errno));
258 ResponseCode Blob::readBlob(const std::string& filename, const uint8_t* aes_key, State state) {
259 ALOGV("reading blob %s", filename.c_str());
291 blobv2& blob = reinterpret_cast<blobv2&>(mBlob);
293 const ssize_t encryptedLength = fileLength - headerLength - blob.info;
303 AES_cbc_encrypt(blob.encrypted, blob.encrypted, encryptedLength, &key, blob.vector,
309 MD5(blob.digested, digestedLength, computedDigest);
310 if (memcmp(blob.digest, computedDigest, MD5_DIGEST_LENGTH) != 0) {
331 keystore::SecurityLevel Blob::getSecurityLevel() const {
335 void Blob::setSecurityLevel(keystore::SecurityLevel secLevel) {