Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcapgo: add read/write support for Decryption Secrets Block (DSB) #6

Merged
merged 3 commits into from
Aug 25, 2022

Conversation

stv0g
Copy link
Contributor

@stv0g stv0g commented Aug 22, 2022

Prebiously tracked in Google repo as: google/gopacket#1042

Originally submitted by: @cfc4n

A Decryption Secrets Block (DSB) stores (session) secrets that enable decryption of packets within the capture file.

see https://github.com/pcapng/pcapng/blob/master/draft-tuexen-opsawg-pcapng.md for more info.

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>

import (
"fmt"
"github.com/google/gopacket"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to change to "github.com/gopacket/gopacket" for the tests to run

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
@stv0g
Copy link
Contributor Author

stv0g commented Aug 23, 2022

Thanks @mosajjal,

I have fixed the imports now.

@mosajjal
Copy link
Contributor

Codes and tests look good. just need to convert the pcap files used in testing to the actual bytes of each packet to make it consistent with other tests. refer to previous PRs or _test files.

@stv0g
Copy link
Contributor Author

stv0g commented Aug 24, 2022

Thanks @mosajjal for the review.

Could you elaborate a bit? It seems like also the other tests read-on the pcapng files:

testf, err := os.Open(filepath.Join("tests", be, test.testName+".pcapng"))

@mosajjal
Copy link
Contributor

to me the preference is to use byte stream rather than a pcap file to test out a particular packet. but if that's not possible for this use case that's fine too. is there any other changes needed for this or is it ready for merge now? Happy to merge it anytime :)

@stv0g
Copy link
Contributor Author

stv0g commented Aug 25, 2022

I think we are better of with the PCAPng files here as we dont test against packet data but rather against the DSB sections within the file.

From my side its ready to merge.

@mosajjal mosajjal merged commit b6a42f7 into gopacket:master Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants