kazu-yamamoto / pgpdump

A PGP packet visualizer
http://www.mew.org/~kazu/proj/pgpdump/
BSD 3-Clause "New" or "Revised" License
174 stars 34 forks source link

Skip file to process when first/CTB is zero #40

Closed galaxiesFarApart closed 10 months ago

galaxiesFarApart commented 10 months ago

It is possible that someone could execute pgpdump against a non-key file which may begin with one or more "zero" bytes. It may also be possible that a legitimate "key file" is being used but its first/CTB byte has been "corrupted" and is now nothing more than "zero". In either case, if the first/CTB byte is "zero", then simply issue message and terminate processing. No need to do anymore work on the file.

Two sample "corrupted" key files and the normal/current pgpdump responses are attached:

DSA_ELGAMAL_test.raw_prezerobytes.pubkey-pgpdump.zip

DSA_ELGAMAL_test.raw_prezerobytes.pubkey-armor-pgpdump.zip

kazu-yamamoto commented 10 months ago

git push -f is appreciated.

kazu-yamamoto commented 10 months ago

@galaxiesFarApart Gentle ping.

This blocks #39.

galaxiesFarApart commented 10 months ago

OK - what do you need for me to do?

kazu-yamamoto commented 10 months ago

Again, please rebase your commits onto master to show minimum difference to me.

galaxiesFarApart commented 10 months ago

I am rather new to git - only started when helping with pgpdump. Other program development (over many years) has been on stand-alone non-collaborative projects (some later ones have been "published" on SourceForge).

I have a local (home, BSD) git repository which I cloned from my github/pgpdump repository. I made changes to packet.c locally and then pushed that to my githug/pgpdump repository.

So will a "rebase from home BSD repo to my github/pgpdump repo" do what you need, or will something else need to be done? I want to make sure to do the right thing.

Do I need to clear out commit history (somewhere)?

kazu-yamamoto commented 10 months ago

The current my master looks:

1

While after trying to merge your branch, the tree looks:

2

I don't want to merge this messy history to my repo.

Github says that the difference is only on packet.c. So, just modify packet.c on my master and commit it then make a pull request. If you don't know what push -f is, a new PR is also acceptable.