ECC import_key now accepts non-standard curve names e.g. "secp112r1", "secp521r1"
Karel Miko
8 years ago
496 | 496 | if (my $curve = $jwkcrv{$key->{crv}}) { |
497 | 497 | return $self->_import_hex($key->{x}, $key->{y}, $key->{d}, $curve); |
498 | 498 | } |
499 | # curve is not JWK compliant e.g. P-192 P-224 P-256 P-384 P-521 (we'll try to import anyway) | |
500 | return $self->_import_hex($key->{x}, $key->{y}, $key->{d}, lc($key->{crv})); | |
499 | 501 | } |
500 | 502 | croak "FATAL: unexpected ECC key hash"; |
501 | 503 | } |
535 | 537 | if (my $curve = $jwkcrv{$h->{crv}}) { |
536 | 538 | return $self->_import_hex($h->{x}, $h->{y}, $h->{d}, $curve); |
537 | 539 | } |
540 | # curve is not JWK compliant e.g. P-192 P-224 P-256 P-384 P-521 (we'll try to import anyway) | |
541 | return $self->_import_hex($h->{x}, $h->{y}, $h->{d}, lc($h->{crv})); | |
538 | 542 | } |
539 | 543 | } |
540 | 544 | elsif ($data =~ /---- BEGIN SSH2 PUBLIC KEY ----(.*?)---- END SSH2 PUBLIC KEY ----/sg) { |