Lines Matching refs:ResponseCode

79 ResponseCode AES_gcm_encrypt(const uint8_t* in, uint8_t* out, size_t len,  in AES_gcm_encrypt()
101 return ResponseCode::SYSTEM_ERROR; in AES_gcm_encrypt()
107 return ResponseCode::NO_ERROR; in AES_gcm_encrypt()
115 ResponseCode AES_gcm_decrypt(const uint8_t* in, uint8_t* out, size_t len, in AES_gcm_decrypt()
137 return ResponseCode::VALUE_CORRUPTED; in AES_gcm_decrypt()
143 return ResponseCode::VALUE_CORRUPTED; in AES_gcm_decrypt()
148 return ResponseCode::NO_ERROR; in AES_gcm_decrypt()
309 static ResponseCode writeBlob(const std::string& filename, Blob blob, blobv3* rawBlob, in writeBlob()
319 return ResponseCode::LOCKED; in writeBlob()
325 return ResponseCode::SYSTEM_ERROR; in writeBlob()
330 if (rc != ResponseCode::NO_ERROR) return rc; in writeBlob()
342 return ResponseCode::SYSTEM_ERROR; in writeBlob()
351 return ResponseCode::SYSTEM_ERROR; in writeBlob()
359 return ResponseCode::SYSTEM_ERROR; in writeBlob()
364 return ResponseCode::NO_ERROR; in writeBlob()
367 ResponseCode LockedKeyBlobEntry::writeBlobs(Blob keyBlob, Blob characteristicsBlob, in writeBlobs()
371 return ResponseCode::SYSTEM_ERROR; in writeBlobs()
373 ResponseCode rc; in writeBlobs()
377 if (rc != ResponseCode::NO_ERROR) { in writeBlobs()
390 ResponseCode Blob::readBlob(const std::string& filename, const std::vector<uint8_t>& aes_key, in readBlob()
392 ResponseCode rc; in readBlob()
398 return (errno == ENOENT) ? ResponseCode::KEY_NOT_FOUND : ResponseCode::SYSTEM_ERROR; in readBlob()
404 return ResponseCode::SYSTEM_ERROR; in readBlob()
409 return ResponseCode::VALUE_CORRUPTED; in readBlob()
415 return ResponseCode::LOCKED; in readBlob()
417 if (state == STATE_UNINITIALIZED) return ResponseCode::UNINITIALIZED; in readBlob()
422 return ResponseCode::VALUE_CORRUPTED; in readBlob()
431 if (rc != ResponseCode::NO_ERROR) { in readBlob()
436 (rc == ResponseCode::VALUE_CORRUPTED)) { in readBlob()
437 return ResponseCode::KEY_PERMANENTLY_INVALIDATED; in readBlob()
450 return ResponseCode::VALUE_CORRUPTED; in readBlob()
458 return ResponseCode::VALUE_CORRUPTED; in readBlob()
472 return ResponseCode::VALUE_CORRUPTED; in readBlob()
483 return ResponseCode::VALUE_CORRUPTED; in readBlob()
492 return ResponseCode::NO_ERROR; in readBlob()
495 std::tuple<ResponseCode, Blob, Blob>
497 std::tuple<ResponseCode, Blob, Blob> result; in readBlobs()
499 if (entry_ == nullptr) return rc = ResponseCode::SYSTEM_ERROR, result; in readBlobs()
502 if (rc != ResponseCode::NO_ERROR && rc != ResponseCode::UNINITIALIZED) { in readBlobs()
512 ResponseCode LockedKeyBlobEntry::deleteBlobs() const { in deleteBlobs()
513 if (entry_ == nullptr) return ResponseCode::NO_ERROR; in deleteBlobs()
516 ResponseCode rc1 = (unlink(entry_->getKeyBlobPath().c_str()) && errno != ENOENT) in deleteBlobs()
517 ? ResponseCode::SYSTEM_ERROR in deleteBlobs()
518 : ResponseCode::NO_ERROR; in deleteBlobs()
519 if (rc1 != ResponseCode::NO_ERROR) { in deleteBlobs()
522 ResponseCode rc2 = (unlink(entry_->getCharacteristicsBlobPath().c_str()) && errno != ENOENT) in deleteBlobs()
523 ? ResponseCode::SYSTEM_ERROR in deleteBlobs()
524 : ResponseCode::NO_ERROR; in deleteBlobs()
525 if (rc2 != ResponseCode::NO_ERROR) { in deleteBlobs()
530 if (rc1 != ResponseCode::NO_ERROR) return rc1; in deleteBlobs()
745 std::tuple<ResponseCode, std::list<LockedKeyBlobEntry>>
760 return std::tuple<ResponseCode, std::list<LockedKeyBlobEntry>&&>{ResponseCode::SYSTEM_ERROR, in list()
789 return std::tuple<ResponseCode, std::list<LockedKeyBlobEntry>&&>{ResponseCode::NO_ERROR, in list()