diff options
Diffstat (limited to 'magic/Magdir/pgp')
-rw-r--r-- | magic/Magdir/pgp | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/magic/Magdir/pgp b/magic/Magdir/pgp index 585475dbb38c3..ecdcf838cc654 100644 --- a/magic/Magdir/pgp +++ b/magic/Magdir/pgp @@ -1,11 +1,50 @@ #------------------------------------------------------------------------------ -# $File: pgp,v 1.14 2017/03/17 21:35:28 christos Exp $ +# $File: pgp,v 1.15 2018/02/24 16:11:23 christos Exp $ # pgp: file(1) magic for Pretty Good Privacy # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html # -0 beshort 0x9900 PGP key public ring -!:mime application/x-pgp-keyring +# Update: Joerg Jenderek +# Note: verified by `gpg -v --debug 0x02 --list-packets < PUBRING263_10.PGP` +#0 byte 0x99 MAYBE PGP 0x99 +0 byte 0x99 +# 99h~10;0110;01~2=old packet type;tag 6=Public-Key Packet;1=two-octet length +# A two-octet body header encodes packet lengths of 192~00C0h - 8383~20BFh +#>1 ubeshort x \b, body length 0x%.4x +# skip Basic.Image Beauty.320 Pic.Icons by looking for low version number +#>3 ubyte x \b, V=%u +#>3 ubyte <5 VERSION OK +>3 ubyte <5 +# next packet type often b4h~(tag 13)~User ID Packet, b0h~(tag 12)~Trust packet +#>>(1.S+3) ubyte x \b, next packet type 0x%x +# skip 9900-v4.bin 9902-v4.bin by looking for valid second packet type (bit 7=1) +#>>(1.S+3) ubyte >0x7F TYPE OK, +>>(1.S+3) ubyte >0x7F +# old versions 2,3 implies Pretty Good Privacy +>>>3 ubyte <4 PGP key public ring (v%u) +!:mime application/pgp-keys +!:ext pgp/ASD +>>>>4 beldate x created %s +# days that this key is valid. If this number is zero, then it does not expire +>>>>8 ubeshort >0 \b, %u days valid +>>>>8 ubeshort =0 \b, not expire +# display key algorithm 1~RSA (Encrypt or Sign) +>>>>10 use key_algo +# Multiprecision Integers (MPI) size +>>>>11 ubeshort x %u bits +# MPI +>>>>13 ubequad x MPI=0x%16.16llx... +# new version implies Pretty Good Privacy (PGP) >= 5.0 or Gnu Privacy Guard (GPG) +>>>3 ubyte >3 PGP/GPG key public ring (v%u) +!:mime application/pgp-keys +!:ext pgp/gpg/pkr/asd +>>>>4 beldate x created %s +# display key algorithm 17~DSA +>>>>8 use key_algo +# Multiprecision Integers (MPI) size +>>>>9 ubeshort x %u bits +>>>>11 ubequad x MPI=0x%16.16llx... + 0 beshort 0x9501 PGP key security ring !:mime application/x-pgp-keyring 0 beshort 0x9500 PGP key security ring |