const unsigned char *keydata = NULL;
size_t keylen = 0;
- if (skey != NULL && !EVP_SKEY_get_raw_key(skey, &keydata, &keylen)) {
+ if (skey != NULL && !EVP_SKEY_get0_raw_key(skey, &keydata, &keylen)) {
ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
return 0;
}
const unsigned char *keydata = NULL;
size_t keylen = 0;
- if (skey != NULL && !EVP_SKEY_get_raw_key(skey, &keydata, &keylen)) {
+ if (skey != NULL && !EVP_SKEY_get0_raw_key(skey, &keydata, &keylen)) {
ERR_raise(ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR);
return 0;
}
return 0;
}
-int EVP_SKEY_get_raw_key(const EVP_SKEY *skey, const unsigned char **key,
- size_t *len)
+int EVP_SKEY_get0_raw_key(const EVP_SKEY *skey, const unsigned char **key,
+ size_t *len)
{
struct raw_key_details_st raw_key;
EVP_SKEY, EVP_SKEY_generate,
EVP_SKEY_import, EVP_SKEY_import_raw_key, EVP_SKEY_up_ref,
-EVP_SKEY_export, EVP_SKEY_get_raw_key, EVP_SKEY_get0_key_id,
+EVP_SKEY_export, EVP_SKEY_get0_raw_key, EVP_SKEY_get0_key_id,
EVP_SKEY_get0_skeymgmt_name, EVP_SKEY_get0_provider_name,
EVP_SKEY_free, EVP_SKEY_is_a, EVP_SKEY_to_provider
- opaque symmetric key allocation and handling functions
const char *propquery);
int EVP_SKEY_export(const EVP_SKEY *skey, int selection,
OSSL_CALLBACK *export_cb, void *export_cbarg);
- int EVP_SKEY_get_raw_key(const EVP_SKEY *skey, const unsigned char **key,
+ int EVP_SKEY_get0_raw_key(const EVP_SKEY *skey, const unsigned char **key,
size_t *len);
const char *EVP_SKEY_get0_key_id(const EVP_SKEY *skey);
more information about the callback. Note that the L<OSSL_PARAM(3)> array that
is passed to the callback is not persistent after the callback returns.
-The EVP_SKEY_get_raw_key() function copies raw key bytes to the passed buffer
-and sets the key len. The operation can fail when the underlying key
-management doesn't support export of the secret key.
+The EVP_SKEY_get0_raw_key() returns a pointer to a raw key bytes to the passed
+address and sets the key len. The returned address is managed by the internal
+key management and shouldn't be freed explicitly. The operation can fail when
+the underlying key management doesn't support export of the secret key.
The EVP_SKEY_get0_key_id() returns a NUL-terminated string providing some
human-readable identifier of the key if provided by the underlying key
EVP_SKEY_up_ref() returns 1 for success and 0 on failure.
-EVP_SKEY_export() and EVP_SKEY_get_raw_key() return 1 for success and 0 on failure.
+EVP_SKEY_export() and EVP_SKEY_get0_raw_key() return 1 for success and 0 on failure.
EVP_SKEY_get0_skeymgmt_name() and EVP_SKEY_get0_provider_name() return the
names of the associated EVP_SKEYMGMT object and its provider correspondigly.
=head1 HISTORY
The B<EVP_SKEY> API and functions EVP_SKEY_export(),
-EVP_SKEY_free(), EVP_SKEY_get_raw_key(), EVP_SKEY_import(),
+EVP_SKEY_free(), EVP_SKEY_get0_raw_key(), EVP_SKEY_import(),
EVP_SKEY_import_raw_key(), EVP_SKEY_up_ref(), EVP_SKEY_generate(),
EVP_SKEY_get0_key_id(), EVP_SKEY_get0_provider_name(),
EVP_SKEY_get0_skeymgmt_name(), EVP_SKEY_is_a(), EVP_SKEY_to_provider()
EVP_SKEY *EVP_SKEY_import_raw_key(OSSL_LIB_CTX *libctx, const char *skeymgmtname,
unsigned char *key, size_t keylen,
const char *propquery);
-int EVP_SKEY_get_raw_key(const EVP_SKEY *skey, const unsigned char **key,
- size_t *len);
+int EVP_SKEY_get0_raw_key(const EVP_SKEY *skey, const unsigned char **key,
+ size_t *len);
const char *EVP_SKEY_get0_key_id(const EVP_SKEY *skey);
int EVP_SKEY_export(const EVP_SKEY *skey, int selection,
OSSL_CALLBACK *export_cb, void *export_cbarg);
goto end;
/* Export raw key */
- if (!TEST_int_gt(EVP_SKEY_get_raw_key(key, &export, &export_len), 0)
+ if (!TEST_int_gt(EVP_SKEY_get0_raw_key(key, &export, &export_len), 0)
|| !TEST_mem_eq(export, export_len, import_key, sizeof(import_key)))
goto end;
if (!TEST_ptr(skey))
goto end;
- if (!TEST_int_gt(EVP_SKEY_get_raw_key(skey, &export_key, &export_length), 0)
+ if (!TEST_int_gt(EVP_SKEY_get0_raw_key(skey, &export_key, &export_length), 0)
|| !TEST_mem_eq(aes_key, KEY_SIZE, export_key, export_length))
goto end;
if (!TEST_ptr(skey))
goto end;
- if (!TEST_int_gt(EVP_SKEY_get_raw_key(skey, &export_key, &export_length), 0)
+ if (!TEST_int_gt(EVP_SKEY_get0_raw_key(skey, &export_key, &export_length), 0)
|| !TEST_mem_eq(des_key, DES_KEY_SIZE, export_key, export_length))
goto end;
EVP_SKEY_import ? 3_5_0 EXIST::FUNCTION:
EVP_SKEY_generate ? 3_5_0 EXIST::FUNCTION:
EVP_SKEY_import_raw_key ? 3_5_0 EXIST::FUNCTION:
-EVP_SKEY_get_raw_key ? 3_5_0 EXIST::FUNCTION:
+EVP_SKEY_get0_raw_key ? 3_5_0 EXIST::FUNCTION:
EVP_SKEY_export ? 3_5_0 EXIST::FUNCTION:
EVP_SKEY_up_ref ? 3_5_0 EXIST::FUNCTION:
EVP_SKEY_free ? 3_5_0 EXIST::FUNCTION: