MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / internalRead

Method internalRead

src/jrd/CryptoManager.cpp:1244–1269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1242 }
1243
1244 CryptoManager::IoResult CryptoManager::internalRead(thread_db* tdbb, FbStatusVector* sv,
1245 Ods::pag* page, IOCallback* io)
1246 {
1247 if (!io->callback(tdbb, sv, page))
1248 return FAILED_IO;
1249
1250 if (page->pag_flags & Ods::crypted_page)
1251 {
1252 if (!cryptPlugin)
1253 {
1254 Arg::Gds(isc_decrypt_error).copyTo(sv);
1255 return FAILED_CRYPT;
1256 }
1257
1258 FbLocalStatus ls;
1259 cryptPlugin->decrypt(&ls, dbb.dbb_page_size - sizeof(Ods::pag),
1260 &page[1], &page[1]);
1261 if (ls->getState() & IStatus::STATE_ERRORS)
1262 {
1263 ERR_post_nothrow(&ls, sv);
1264 return FAILED_CRYPT;
1265 }
1266 }
1267
1268 return SUCCESS_ALL;
1269 }
1270
1271 bool CryptoManager::write(thread_db* tdbb, FbStatusVector* sv, Ods::pag* page, IOCallback* io)
1272 {

Callers

nothing calls this directly

Calls 6

GdsClass · 0.85
ERR_post_nothrowFunction · 0.85
callbackMethod · 0.45
copyToMethod · 0.45
decryptMethod · 0.45
getStateMethod · 0.45

Tested by

no test coverage detected