<html 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=Windows-1252">
<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;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="DE" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Yes, MY_NID is really NID_whatever. I tried it with putting <span style="font-size:10.0pt">
OPENSSL_init_crypto(0, NULL); at start of my main().<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">Did not make any difference…<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The Integer value of MY_NID will be printed out and is the correct integer value.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">And i tried another thing. I replaced the two dll-libraries with the new created ones and then i run my Code and there all will be printed out correctly. BUT the whole time i used some older dll-libraries of openssl, (1.1.0f) and for development
 i used the latest 1.1.1-dev and then i build this, which has added a new x509 extension (Admission), which has a new OID (NID_extX509Admission, etc.) and there the short and long name will be printed out correctly after Building the Code. So this is a Little
 bit strange.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Or must i replace the dll-libraries every time i build the Code? But when, why has it worked with the old ones and the 1.1.1-dev (master branch)?</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards</p>
<p class="MsoNormal">Matthias</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="border:none;padding:0cm"><b>Von: </b><a href="mailto:levitte@openssl.org">Richard Levitte</a><br>
<b>Gesendet: </b>Montag, 10. Juli 2017 06:14<br>
<b>An: </b><a href="mailto:openssl-users@openssl.org">openssl-users@openssl.org</a><br>
<b>Betreff: </b>Re: [openssl-users] OpenSSL 1.1.0 providing new OIDs to source code</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt">In message <AM5P195MB018008B87ACD89D37B629CF3FBAB0@AM5P195MB0180.EURP195.PROD.OUTLOOK.COM> on Sat, 8 Jul 2017 23:31:00 +0000, Matthias Ballreich <matthias.ballreich@outlook.de> said:<br>
<br>
matthias.ballreich> Hi there,<br>
matthias.ballreich> <br>
matthias.ballreich> i want to contribute some more OIDs. Therefore i added the OIDs inside<br>
matthias.ballreich> the „Objects.txt“ inside /crypto/objects<br>
matthias.ballreich> <br>
matthias.ballreich> Then i run these commands:<br>
matthias.ballreich> <br>
matthias.ballreich> perl objects.pl objects.txt obj_mac.num .<br>
matthias.ballreich> ./../include/openssl/obj_mac.h<br>
matthias.ballreich> <br>
matthias.ballreich> perl obj_dat.pl ../../include/openssl/obj_mac.h obj_dat.h<br>
matthias.ballreich> <br>
matthias.ballreich> perl objxref.pl obj_mac.num obj_xref.txt > obj_xref.h<br>
<br>
Sure, that looks fine to me<br>
<br>
matthias.ballreich> The files are generated / updated. Then i build the source which<br>
matthias.ballreich> builds fine without any exceptions. Then i tried to use the generated<br>
matthias.ballreich> NIDs in my Code. For test purposes i tried to print out the short and<br>
matthias.ballreich> Long Name of my new oid with OBJ_nid2sn(MY_NID) and OBJ_nid2(MY_NID).<br>
matthias.ballreich> But here it prints out an empty string.<br>
matthias.ballreich> <br>
matthias.ballreich> When o try to use my NID with X509_get_ext_by_NID(cert, MY_NID, -1)<br>
matthias.ballreich> the Output is -2.<br>
matthias.ballreich> <br>
matthias.ballreich> So where is the Problem or what i’m doing wrong here? Thanks!<br>
<br>
If you've come that far, MY_NID (which I assume is really<br>
NID_whatever) obviously exists, or your code wouldn't even have<br>
compiled.  One possibility remains, that for some reason, libcrypto<br>
hasn't been initialised like it should.  This can happen if you only<br>
call a very select set of OpenSSL functions.  What happens if you add<br>
this at the start of your main()?<br>
<br>
    OPENSSL_init_crypto(0, NULL);<br>
<br>
(note, that should be seen as a temporary measure, as this is called<br>
internally in quite a number of spots, so for larger uses of OpenSSL<br>
functionality, you shouldn't need that)<br>
<br>
Cheers,<br>
Richard<br>
<br>
-- <br>
Richard Levitte         levitte@openssl.org<br>
OpenSSL Project         <a href="http://www.openssl.org/~levitte/">http://www.openssl.org/~levitte/</a><br>
-- <br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users">
https://mta.openssl.org/mailman/listinfo/openssl-users</a><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>