/*
- * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
const struct type_and_structure_st *output_info,
unsigned char **pp)
{
- OSSL_ENCODER_CTX *ctx = NULL;
int ret;
for (ret = -1;
*/
size_t len = INT_MAX;
int pp_was_NULL = (pp == NULL || *pp == NULL);
+ OSSL_ENCODER_CTX *ctx;
ctx = OSSL_ENCODER_CTX_new_for_pkey(a, selection,
output_info->output_type,
ret = INT_MAX - (int)len;
}
OSSL_ENCODER_CTX_free(ctx);
- ctx = NULL;
}
if (ret == -1)
return i2d_provided(a, EVP_PKEY_PUBLIC_KEY, output_info, pp);
}
- switch (EVP_PKEY_get_id(a)) {
+ switch (EVP_PKEY_get_base_id(a)) {
case EVP_PKEY_RSA:
return i2d_RSAPublicKey(EVP_PKEY_get0_RSA(a), pp);
#ifndef OPENSSL_NO_DSA