6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
11/5/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#5896] Enabling retrieving PGP-PublicKeys withing the Horde pref System
*
Your Email Address
*
Spam protection
Enter the letters below:
.__ .___. .. .. . [ __[__ |_/ |\ |\ / [_./| | \| \| \/
Comment
> This patch enables that IMP is first looking within horde's own > preference storage to retrieve a public key. This can be very > comfortable on systems where a lot of users are using webmail with > pgp however nor exchange keys nor upload them on keyservers due to > various reasons. > > As well it fixes some behaviour lookup by setting the fingerprint as > the mailaddress if it haven't yet been set. > > > > --- ./lib/Crypt/PGP.php-old 2007-11-18 20:31:33.000000000 +0100 > > +++ ./lib/Crypt/PGP.php 2007-11-18 21:00:10.000000000 +0100 > > @@ -163,6 +163,18 @@ > > return $key_info; > > } > > > > + /** > > + * Retrieves the public key from the preference storage. > > + */ > > + function _getPublicKeyFromPrefs($address) > > + { > > + global $conf; > > + $userprefs = > &Prefs::singleton($conf['prefs']['driver'],'imp', $address, '', null, > false); > > + $userprefs->retrieve(); > > + return $pk = $userprefs->getValue('pgp_public_key'); > > + } > > + > > + > > /** > > * Retrieves a public key by e-mail. > > * First, the key will be attempted to be retrieved from a user's > > @@ -178,10 +190,20 @@ > > */ > > function getPublicKey($address, $fingerprint = null) > > { > > - /* Try retrieving by e-mail only first. */ > > + /* 1. try users database */ > > + $prefs_key = $this->_getPublicKeyFromPrefs($address); > > + if(strlen($prefs_key) > 100 && > > + preg_match('/-----BEGIN PGP ([^-]+)-----/', $prefs_key)){ > > + return $prefs_key; > > + } > > + > > + /* 2. try retrieving from Contacts */ > > $result = $GLOBALS['registry']->call('contacts/getField', > array($address, IMP_PGP_PUBKEY_FIELD, $this->_sources, false, true)); > > > > /* TODO: Retrieve by ID. */ > > + if($fingerprint == null){ > > + $fingerprint = $address; > > + } > > > > /* Try retrieving via a PGP public keyserver. */ > > if (is_a($result, 'PEAR_Error') && !empty($fingerprint)) { > > > >
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers