|
System | : | Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686 |
Software | : | Apache. PHP/5.3.6-13ubuntu3.10 |
ID | : | uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
|
|
Safe Mode | : | OFF |
Open_Basedir | : | OFF |
Freespace | : | 24 GB of 70.42 GB (34.09%) |
|
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON |
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
|
[ System Info ]
[ Processes ]
[ SQL Manager ]
[ Eval ]
[ Encoder ]
[ Mailer ]
[ Back Connection ]
[ Backdoor Server ]
[ Kernel Exploit Search ]
[ MD5 Decrypter ]
[ Reverse IP ]
[ Kill Shell ]
[ FTP Brute-Force ]
|
|
/
usr/
share/
pyshared/
landscape/
lib/
- drwxr-xr-x
|
Viewing file: gpg.py (1.26 KB) -rw-r--r--Select action/file-type:  ( +) |  ( +) |  ( +) | Code ( +) | Session ( +) |  ( +) | SDB ( +) |  ( +) |  ( +) |  ( +) |  ( +) |  ( +) |
import shutil import tempfile
from twisted.internet.utils import getProcessOutputAndValue
class InvalidGPGSignature(Exception): """Raised when the gpg signature for a given file is invalid."""
def gpg_verify(filename, signature, gpg="/usr/bin/gpg"): """Verify the GPG signature of a file.
@param filename: Path to the file to verify the signature against. @param signature: Path to signature to use. @param gpg: Optionally, path to the GPG binary to use. @return: a C{Deferred} resulting in C{True} if the signature is valid, C{False} otherwise. """
def remove_gpg_home(ignored): shutil.rmtree(gpg_home) return ignored
def check_gpg_exit_code((out, err, code)): if code != 0: raise InvalidGPGSignature("%s failed (out='%s', err='%s', " "code='%d')" % (gpg, out, err, code))
gpg_home = tempfile.mkdtemp() args = ("--no-options", "--homedir", gpg_home, "--no-default-keyring", "--ignore-time-conflict", "--keyring", "/etc/apt/trusted.gpg", "--verify", signature, filename)
result = getProcessOutputAndValue(gpg, args=args) result.addBoth(remove_gpg_home) result.addCallback(check_gpg_exit_code) return result
|