mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-25 03:16:02 +00:00
Allow to specify extension value as critical
This commit is contained in:
parent
8123521307
commit
0dabb0c090
@ -47,7 +47,7 @@ class PrivateKey extends DH
|
||||
* Returns the public key
|
||||
*
|
||||
* @access public
|
||||
* @return DH
|
||||
* @return DH\PublicKey
|
||||
*/
|
||||
public function getPublicKey()
|
||||
{
|
||||
|
@ -331,4 +331,4 @@ class Ed25519 extends TwistedEdwards
|
||||
|
||||
return [$x3, $y3, $z3, $t3];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ trait Common
|
||||
* - neither the curve or the base point are generated verifiably randomly.
|
||||
* ecdpVer2:
|
||||
* - curve and base point are generated verifiably at random and curve.seed is present
|
||||
* ecdpVer3:
|
||||
* ecdpVer3:
|
||||
* - base point is generated verifiably at random but curve is not. curve.seed is present
|
||||
*/
|
||||
// other (optional) parameters can be calculated using the methods discused at
|
||||
@ -552,4 +552,4 @@ trait Common
|
||||
{
|
||||
self::$useNamedCurves = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -670,10 +670,11 @@ class X509
|
||||
*/
|
||||
private function mapOutExtensions(&$root, $path)
|
||||
{
|
||||
foreach ($this->extensionValues as $id => $value) {
|
||||
foreach ($this->extensionValues as $id => [$critical, $value]) {
|
||||
$root['tbsCertificate']['extensions'][] = [
|
||||
'extnId' => $id,
|
||||
'extnValue' => $value,
|
||||
'critical' => $critical,
|
||||
];
|
||||
}
|
||||
|
||||
@ -4079,9 +4080,10 @@ class X509
|
||||
*
|
||||
* @param string $id
|
||||
* @param mixed $value
|
||||
* @param bool $critical
|
||||
*/
|
||||
public function setExtensionValue($id, $value)
|
||||
public function setExtensionValue($id, $value, $critical = false)
|
||||
{
|
||||
$this->extensionValues[$id] = $value;
|
||||
$this->extensionValues[$id] = [$critical, $value];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user