Skip to content

Commit

Permalink
Merge pull request #4 from jim-p/master
Browse files Browse the repository at this point in the history
Support ECDSA Certificate Authorities
  • Loading branch information
ukrbublik committed Nov 25, 2019
2 parents 76a558c + 43909f6 commit 9490a34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/OID.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public static function getAlgoOID($cipher, $digest) {
default:
return false;
}
case OPENSSL_KEYTYPE_EC:
switch($digest) {
case OPENSSL_ALGO_SHA1:
return self::getOIDFromName('ecdsa-with-SHA1');
default:
return false;
}
case OPENSSL_KEYTYPE_DSA:
switch($digest) {
case OPENSSL_ALGO_SHA1:
Expand Down Expand Up @@ -100,6 +107,11 @@ public static function getAlgoOID($cipher, $digest) {
"1.2.840.113549.1.1.3" => "md4withRSAEncryption",
"1.2.840.113549.1.1.4" => "md5withRSAEncryption",
"1.2.840.113549.1.1.5" => "sha1withRSAEncryption",
//ec
"1.2.840.10045.4.1" => "ecdsa-with-SHA1",
"1.2.840.10045.4.3.2" => "ecdsa-with-sha256",
"1.2.840.10045.4.3.3" => "ecdsa-with-sha384",
"1.2.840.10045.4.3.4" => "ecdsa-with-sha512",
//Diffie-Hellman
"1.2.840.10046.2.1" => "dhPublicNumber",

Expand Down
2 changes: 0 additions & 2 deletions src/X509_CRL.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ static function create($ci, $ca_pkey, $ca_cert) {
if($ca_pkey_details === false)
return false;
$ca_pkey_type = $ca_pkey_details['type'];
if($ca_pkey_type == OPENSSL_KEYTYPE_EC || $ca_pkey_type == -1)
return false;
if(!in_array($ca_pkey_type, $algs_cipher))
return false;

Expand Down

0 comments on commit 9490a34

Please sign in to comment.