void *encoded = NULL;
long encoded_len = 0;
EVP_PKEY *pkey2 = NULL;
+ EVP_PKEY *pkey3 = NULL;
void *encoded2 = NULL;
long encoded2_len = 0;
int ok = 0;
output_type, output_structure,
(flags & FLAG_DECODE_WITH_TYPE ? type : NULL),
selection, pass))
+ || ((output_structure == NULL
+ || strcmp(output_structure, "type-specific") != 0)
+ && !TEST_true(decode_cb(file, line, (void **)&pkey3, encoded, encoded_len,
+ output_type, output_structure,
+ (flags & FLAG_DECODE_WITH_TYPE ? type : NULL),
+ 0, pass)))
|| !TEST_true(encode_cb(file, line, &encoded2, &encoded2_len, pkey2, selection,
output_type, output_structure, pass, pcipher)))
goto end;
if (selection == OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) {
- if (!TEST_int_eq(EVP_PKEY_parameters_eq(pkey, pkey2), 1))
+ if (!TEST_int_eq(EVP_PKEY_parameters_eq(pkey, pkey2), 1)
+ || (pkey3 != NULL
+ && !TEST_int_eq(EVP_PKEY_parameters_eq(pkey, pkey3), 1)))
goto end;
} else {
- if (!TEST_int_eq(EVP_PKEY_eq(pkey, pkey2), 1))
+ if (!TEST_int_eq(EVP_PKEY_eq(pkey, pkey2), 1)
+ || (pkey3 != NULL
+ && !TEST_int_eq(EVP_PKEY_eq(pkey, pkey3), 1)))
goto end;
}
OPENSSL_free(encoded);
OPENSSL_free(encoded2);
EVP_PKEY_free(pkey2);
+ EVP_PKEY_free(pkey3);
return ok;
}