| 101 | // Fetch any uncached cipher keys. |
| 102 | loop choose { |
| 103 | when(EKPGetLatestBaseCipherKeysReply reply = wait(getUncachedLatestEncryptCipherKeys(db, request))) { |
| 104 | // Insert base cipher keys into cache and construct result. |
| 105 | for (const EKPBaseCipherDetails& details : reply.baseCipherDetails) { |
| 106 | EncryptCipherDomainId domainId = details.encryptDomainId; |
| 107 | if (domains.count(domainId) > 0 && cipherKeys.count(domainId) == 0) { |
| 108 | Reference<BlobCipherKey> cipherKey = cipherKeyCache->insertCipherKey( |
| 109 | domainId, details.baseCipherId, details.baseCipherKey.begin(), details.baseCipherKey.size()); |
| 110 | ASSERT(cipherKey.isValid()); |
| 111 | cipherKeys[domainId] = cipherKey; |
| 112 | } |
| 113 | } |
| 114 | // Check for any missing cipher keys. |
| 115 | for (auto& domain : request.encryptDomainInfos) { |
| 116 | if (cipherKeys.count(domain.domainId) == 0) { |
| 117 | TraceEvent(SevWarn, "GetLatestEncryptCipherKeys_KeyMissing").detail("DomainId", domain.domainId); |
| 118 | throw encrypt_key_not_found(); |
| 119 | } |
| 120 | } |
| 121 | break; |
| 122 | } |
| 123 | // In case encryptKeyProxy has changed, retry the request. |
| 124 | when(wait(onEncryptKeyProxyChange(db))) {} |
| 125 | } |
nothing calls this directly
no test coverage detected