#if OPENSSL_VERSION_NUMBER >= 0x1010100fL && !defined(OPENSSL_NO_EC)
#include "openssl_ed_private_key.h"
+#include "openssl_util.h"
#include <utils/debug.h>
METHOD(private_key_t, get_encoding, bool,
private_private_key_t *this, cred_encoding_type_t type, chunk_t *encoding)
{
- u_char *p;
-
if (this->engine)
{
return FALSE;
{
bool success = TRUE;
- *encoding = chunk_alloc(i2d_PrivateKey(this->key, NULL));
- p = encoding->ptr;
- i2d_PrivateKey(this->key, &p);
+ *encoding = openssl_i2chunk(PrivateKey, this->key);
if (type == PRIVKEY_PEM)
{