Project

General

Profile

Actions

Bug #5251

closed

EVP_PKEY_base_id returns 0

Added by Varun Patil almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Security
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Tags:

Description

We use EVP_PKEY_base_id to get the key type, which is required when using HMAC signing. Latest ndn-cxx.
This might be a bug in OpenSSL. Thoughts?

The following code prints 0 for me, and HMAC signing fails.

#include <openssl/evp.h>
#include <openssl/rsa.h>

void main() {
    EVP_PKEY *pkey = NULL;
    unsigned char buf[32] = {1};

    if (!(pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL, buf, 32))) {
        exit(1);
    }
    printf ("%d\n", EVP_PKEY_base_id(pkey));
}
$ openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

Related issues 2 (1 open1 closed)

Related to ndn-cxx - Feature #5154: OpenSSL 3.0 supportClosedDavide Pesavento

Actions
Related to ndn-cxx - Task #5241: Redesign support for HMAC keysNew

Actions
Actions

Also available in: Atom PDF