<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=utf-8">
<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;}
.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">
<div class="WordSection1">
<p class="MsoNormal">Hi there,</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">is it normal that OpenSSL removes the leading Zeros in an ASN1_INTEGER?</p>
<p class="MsoNormal">I tried to read the Certificate Serial and the Certificate Serial in the AuthorityKeyID-Extension with C++, which works very well, but i noticed that OpenSSL removes the leading Zeros on it.</p>
<p class="MsoNormal">The real ASN1-Value is: 00BEED73EE for example, but i got only BEED73EE.</p>
<p class="MsoNormal">If i view the Certificate inside Microsoft Cert Tool (Certmgr.exe) the leading Zeros are listed there. Same on Firefox, if i Import and view the Certificate there.</p>
<p class="MsoNormal">So is this the correct way of handling inside OpenSSL or is it a bug or?</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is there a way to prevent that?</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m using  OpenSSL 1.0.2j.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hope someone could explain it a little bit.</p>
<p class="MsoNormal">Thanks!</p>
</div>
</body>
</html>