Skip to content

Commit

Permalink
Fixup debug
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Jan 20, 2016
1 parent e66e914 commit 14af227
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/ipsec/esp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZ
d:push(ethernet:new({type=0x86dd}))
-- Check integrity
local p = d:packet()
print("original", lib.hexdump(ffi.string(packet.data(p), packet.length(p))))
local p_enc = enc:encapsulate(packet.clone(p))
print("encrypted", lib.hexdump(ffi.string(packet.data(p_enc), packet.length(p_enc))))
local p2 = dec:decapsulate(p_enc)
print(lib.hexdump(ffi.string(packet.data(p), packet.length(p))))
print(lib.hexdump(ffi.string(packet.data(p_enc), packet.length(p_enc))))
print(lib.hexdump(ffi.string(packet.data(p2), packet.length(p2))))
print("decrypted", lib.hexdump(ffi.string(packet.data(p2), packet.length(p2))))
if p2 and p2.length == p.length and C.memcmp(p, p2, p.length) == 0 then
print("selftest passed")
else
Expand Down

0 comments on commit 14af227

Please sign in to comment.