Check for 0.9.0 bad keys from old Crypt_RSA library
This commit is contained in:
parent
10410907a0
commit
c4273f0ef3
@ -50,7 +50,15 @@ class Magicsig extends Memcached_DataObject
|
||||
{
|
||||
$obj = parent::staticGet(__CLASS__, $k, $v);
|
||||
if (!empty($obj)) {
|
||||
return Magicsig::fromString($obj->keypair);
|
||||
$obj = Magicsig::fromString($obj->keypair);
|
||||
|
||||
// Double check keys: Crypt_RSA did not
|
||||
// consistently generate good keypairs.
|
||||
// We've also moved to 1024 bit keys.
|
||||
if (strlen($obj->publicKey->modulus->toBits()) != 1024) {
|
||||
$obj->delete();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return $obj;
|
||||
|
Loading…
Reference in New Issue
Block a user