<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">I am looking at porting an application that handles Card Verifiable Certificate (CVC) requests from OpenSSL 1.1.1 to 3.0.8.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The requests are basic PKCS#10 but the public key algorithm uses different OIDs.  To deal with this the application creates new objects and registers a new EVP_PKEY_ASN1_METHOD for each, copied from an existing.  This
 is sufficient for X509_REQ_get_pubkey() to work with OpenSSL 1.1.1.  These are the main function calls minus error handling:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">OBJ_create("1.3.36.3.5.3.1", "ecc-with-sha256", "ecc-with-sha256");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">meth_default = EVP_PKEY_asn1_find(NULL, NID_X9_62_id_ecPublicKey);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">meth_new = EVP_PKEY_asn1_new(OBJ_txt2nid("ecc-with-sha256"), 0, "EC", "G2 ECC with SHA256");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">EVP_PKEY_asn1_copy(meth_new, meth_default);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">EVP_PKEY_asn1_add0(meth_new);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">req = PEM_read_bio_X509_REQ(in, NULL, NULL, NULL);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">pubkey = X509_REQ_get_pubkey(req);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The same code using 3.0.8 gets a decode error from X509_PUBKEY_get0.  I assume this has to do with the introduction of providers and decoders in OpenSSL 3.  What are my options for treating these CVC public keys like
 a regular ecPublicKey?  Can I simply add the alternate OIDs to an existing decoder?  Do I need to create my own duplicate of an existing decoder?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Andrew.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>