MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.137.159.134
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /../sys/../lib/rpm/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //../sys/../lib/rpm/tgpg
#!/bin/sh


for pkg in $*
do
    if [ "$pkg" = "" -o ! -e "$pkg" ]; then
	echo "no package supplied" 1>&2
	exit 1
    fi

    plaintext=`mktemp ${TMPDIR:-/tmp}/tgpg-$$.XXXXXX`
    detached=`mktemp ${TMPDIR:-/tmp}/tgpg-$$.XXXXXX`

# --- Extract detached signature
    rpm -qp -vv --qf '%{siggpg:armor}' $pkg > $detached

# --- Figger the offset of header+payload in the package
    leadsize=96
    o=`expr $leadsize + 8`

    set `od -j $o -N 8 -t u1 $pkg`
    il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
    dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`

    sigsize=`expr 8 + 16 \* $il + $dl`
    o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8`

# --- Extract header+payload
    dd if=$pkg ibs=$o skip=1 2>/dev/null > $plaintext

# --- Verify DSA signature using gpg
    gpg --batch -vv --debug 0xfc02 --verify $detached $plaintext

# --- Clean up
    rm -f $detached $plaintext
done

MMCT - 2023