Merge pull request #46 from jasekiw/master
https://github.com/phpseclib/phpseclib/issues/1113
This commit is contained in:
commit
2561004fcd
@ -12,5 +12,7 @@ env:
|
|||||||
- PHPSECLIB="2.0.0"
|
- PHPSECLIB="2.0.0"
|
||||||
- PHPSECLIB="2.0.1"
|
- PHPSECLIB="2.0.1"
|
||||||
- PHPSECLIB="2.0.2"
|
- PHPSECLIB="2.0.2"
|
||||||
|
- PHPSECLIB="2.0.3"
|
||||||
|
- PHPSECLIB="2.0.4"
|
||||||
|
|
||||||
before_script: 'sed -i "s/\"phpseclib\/phpseclib\": \"[^\"]*/\"phpseclib\/phpseclib\": \"$PHPSECLIB/" composer.json && composer install --prefer-source --dev'
|
before_script: 'sed -i "s/\"phpseclib\/phpseclib\": \"[^\"]*/\"phpseclib\/phpseclib\": \"$PHPSECLIB/" composer.json && composer install --prefer-source --dev'
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"phpseclib/phpseclib": ">=2.0.0 <2.0.3"
|
"phpseclib/phpseclib": ">=2.0.0 <=2.0.4"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "~4.0"
|
"phpunit/phpunit": "~4.0"
|
||||||
|
@ -245,8 +245,18 @@ class OpenPGP_Crypt_RSA {
|
|||||||
$rsa = self::crypt_rsa_key($mod, $exp);
|
$rsa = self::crypt_rsa_key($mod, $exp);
|
||||||
|
|
||||||
if($private) {
|
if($private) {
|
||||||
if($packet->key['p'] && $packet->key['q']) $rsa->primes = array($packet->key['p'], $packet->key['q']);
|
/**
|
||||||
if($packet->key['u']) $rsa->coefficients = array($packet->key['u']);
|
* @see https://github.com/phpseclib/phpseclib/issues/1113
|
||||||
|
* Primes and coefficients now use BigIntegers.
|
||||||
|
**/
|
||||||
|
//set the primes
|
||||||
|
if($packet->key['p'] && $packet->key['q'])
|
||||||
|
$rsa->primes = array(
|
||||||
|
1 => new Math_BigInteger($packet->key['p'], 256),
|
||||||
|
2 => new Math_BigInteger($packet->key['q'], 256)
|
||||||
|
);
|
||||||
|
// set the coefficients
|
||||||
|
if($packet->key['u']) $rsa->coefficients = array(2 => new Math_BigInteger($packet->key['u'], 256));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rsa;
|
return $rsa;
|
||||||
|
Loading…
Reference in New Issue
Block a user