<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Yes, it’s annoying, but it’s historic. I looked into changing this at one point.
<div class=""><br class="">
</div>
<div class="">I recommend using ASN1_TIME_cmp_time_t() (from the master branch) instead, for the results you are expecting.<br class="">
<div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">--</div>
<div class="">-Todd Short</div>
<div class="">// <a href="mailto:tshort@akamai.com" class="">tshort@akamai.com</a></div>
<div class="">// "One if by land, two if by sea, three if by the Internet."</div>
</div>
</div>
</div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Sep 9, 2017, at 10:10 AM, Dmitry Belyavsky <<a href="mailto:beldmit@gmail.com" class="">beldmit@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hello,
<div class=""><br class="">
</div>
<div class="">The X509_cmp_time function is documented as returning -1 or 1 on success and 0 on error.</div>
<div class=""><br class="">
</div>
<div class="">In fact it returns result of strcmp:</div>
<div class="">int X509_cmp_time(const ASN1_TIME *ctm, time_t *cmp_time) { <br class="">
... <br class="">
    i = strcmp(buff1, buff2); <br class="">
    if (i == 0)                 /* wait a second then return younger <span class="gmail-moz-smiley-s1" title=":-)">
</span>*/ <br class="">
        return -1; <br class="">
    else <br class="">
        return i; <br class="">
} <br class="">
</div>
<div class=""><br class="">
</div>
<div class="">According to documentation to the strcmp,</div>
<div class=""><br class="">
</div>
<div class="">The strcmp() and strncmp() functions return an integer less than, equal to, or greater than  zero  if  s1 (or the first n bytes thereof) is found, respectively, to be less than, to match, or be greater than s2. <br class="">
</div>
<div class=""><br class="">
</div>
<div class="">It means (and have been met in practice) that X509_cmp_time() returns other values than 1/-1.</div>
<div class="">So it seems reasonable to either update documentation or fix the behavior.</div>
<div class=""><br class="">
</div>
<div class="">Thank you!<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div class="gmail_signature">SY, Dmitry Belyavsky</div>
</div>
</div>
-- <br class="">
openssl-dev mailing list<br class="">
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-dev" class="">
https://mta.openssl.org/mailman/listinfo/openssl-dev</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>