/* Sanity check the input if the input is not raw */
if (!rawin
- && (pkey_op == EVP_PKEY_OP_SIGN || pkey_op == EVP_PKEY_OP_VERIFY
- || pkey_op == EVP_PKEY_OP_VERIFYRECOVER)) {
+ && (pkey_op == EVP_PKEY_OP_SIGN || pkey_op == EVP_PKEY_OP_VERIFY)) {
if (buf_inlen > EVP_MAX_MD_SIZE) {
BIO_printf(bio_err,
"Error: The non-raw input data length %d is too long - max supported hashed size is %d\n",
setup("test_pkeyutl");
-plan tests => 23;
+plan tests => 24;
# For the tests below we use the cert itself as the TBS file
"Verify an Ed448 signature against a piece of data, no -rawin");
}
+my $sigfile;
sub tsignverify {
my $testtext = shift;
my $privkey = shift;
my $data_to_sign = srctop_file('test', 'data.bin');
my $other_data = srctop_file('test', 'data2.bin');
- my $sigfile = basename($privkey, '.pem') . '.sig';
+ $sigfile = basename($privkey, '.pem') . '.sig';
my @args = ();
plan tests => 5;
}
SKIP: {
- skip "RSA is not supported by this OpenSSL build", 1
+ skip "RSA is not supported by this OpenSSL build", 3
if disabled("rsa");
subtest "RSA CLI signature generation and verification" => sub {
"-rawin", "-digest", "sha256");
};
+ ok(run(app((['openssl', 'pkeyutl', '-verifyrecover', '-in', $sigfile,
+ '-pubin', '-inkey', srctop_file('test', 'testrsapub.pem')]))),
+ "RSA: Verify signature with -verifyrecover");
+
subtest "RSA CLI signature and verification with pkeyopt" => sub {
tsignverify("RSA",
srctop_file("test","testrsa.pem"),
"-rawin", "-digest", "sha256",
"-pkeyopt", "rsa_padding_mode:pss");
};
+
}
SKIP: {
# openssl pkeyutl -decap -inkey rsa_priv.pem -in encap_out.bin -out decap_out.bin
# decap_out is equal to secret
SKIP: {
- skip "RSA is not supported by this OpenSSL build", 3
+ skip "RSA is not supported by this OpenSSL build", 5
if disabled("rsa");
# Self-compat