Browse Source

Have the engine pass a magic value to pgp_init_.

main
Neal H. Walfield 9 months ago
parent
commit
9e93fbdcb3
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/lib.rs

+ 4
- 1
src/lib.rs View File

@ -218,12 +218,15 @@ ffi!(fn pgp_init_(session: *mut Session, _in_first: bool,
pep_identity_list_item_size: c_uint,
timestamp_size: c_uint,
_stringpair_size: c_uint,
_stringpair_list_size: c_uint)
_stringpair_list_size: c_uint,
magic: c_uint)
-> Result<()>
{
use std::mem::size_of;
use memoffset::offset_of;
assert_eq!(magic, 0xDEADBEEF);
assert!(session_size as usize >= size_of::<Session>());
assert_eq!(session_cookie_offset as usize,
offset_of!(Session, ks));


Loading…
Cancel
Save