MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dump_encrypted_write

Function dump_encrypted_write

freebsd/kern/kern_shutdown.c:1418–1446  ·  view source on GitHub ↗

Encrypt data and call dumper. */

Source from the content-addressed store, hash-verified

1416
1417/* Encrypt data and call dumper. */
1418static int
1419dump_encrypted_write(struct dumperinfo *di, void *virtual,
1420 vm_offset_t physical, off_t offset, size_t length)
1421{
1422 static uint8_t buf[KERNELDUMP_BUFFER_SIZE];
1423 struct kerneldumpcrypto *kdc;
1424 int error;
1425 size_t nbytes;
1426
1427 kdc = di->kdcrypto;
1428
1429 while (length > 0) {
1430 nbytes = MIN(length, sizeof(buf));
1431 bcopy(virtual, buf, nbytes);
1432
1433 if (dump_encrypt(kdc, buf, nbytes) != 0)
1434 return (EIO);
1435
1436 error = dump_write(di, buf, physical, offset, nbytes);
1437 if (error != 0)
1438 return (error);
1439
1440 offset += nbytes;
1441 virtual = (void *)((uint8_t *)virtual + nbytes);
1442 length -= nbytes;
1443 }
1444
1445 return (0);
1446}
1447#endif /* EKCD */
1448
1449static int

Callers 1

_dump_appendFunction · 0.85

Calls 2

dump_encryptFunction · 0.85
dump_writeFunction · 0.85

Tested by

no test coverage detected