<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Max,<br>
<br>
The changes look fine. I did notice in the files that there is a
header block comment that has a last modified date from the original
code. Should those be updated to 2018?<br>
<br>
--Jamil<br>
<br>
<div class="moz-cite-prefix">On 11/23/2018 6:31 AM, Weijun Wang
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:D989B0FB-61DE-478C-8D03-5D2A89312632@oracle.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
I was curious in some SunEC internals and turned EC_DEBUG on, and
found out the library cannot be built. It looks like back when we
switched to warnings-as-errors some codes are not updated. Here is
the patch:
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""><b
class="">diff --git
a/src/jdk.crypto.ec/share/native/libsunec/impl/ec.c
b/src/jdk.crypto.ec/share/native/libsunec/impl/ec.c</b></span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(195, 55,
32); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""><b
class="">---
a/src/jdk.crypto.ec/share/native/libsunec/impl/ec.c</b></span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(52, 188,
38); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""><b
class="">+++
b/src/jdk.crypto.ec/share/native/libsunec/impl/ec.c</b></span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(213, 59,
211); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">@@
-109,16 +109,16 @@</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
printf("\n");</span></div>
<p style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255); min-height: 13px;" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""> </span><br
class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
if (k1 != NULL) {</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(195, 55,
32); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">-
mp_tohex(k1, mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(52, 188,
38); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">+
mp_tohex((mp_int*)k1, mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
printf("ec_points_mul: scalar k1: %s\n",
mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(195, 55,
32); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">-
mp_todecimal(k1, mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(52, 188,
38); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">+
mp_todecimal((mp_int*)k1, mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
printf("ec_points_mul: scalar k1: %s (dec)\n",
mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
}</span></div>
<p style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255); min-height: 13px;" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""> </span><br
class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
if (k2 != NULL) {</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(195, 55,
32); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">-
mp_tohex(k2, mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(52, 188,
38); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">+
mp_tohex((mp_int*)k2, mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
printf("ec_points_mul: scalar k2: %s\n",
mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(195, 55,
32); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">-
mp_todecimal(k2, mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(52, 188,
38); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">+
mp_todecimal((mp_int*)k2, mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
printf("ec_points_mul: scalar k2: %s (dec)\n",
mpstr);</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">
}</span></div>
<p style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255); min-height: 13px;" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""> </span><br
class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""><b
class="">diff --git
a/src/jdk.crypto.ec/share/native/libsunec/impl/ecdecode.c
b/src/jdk.crypto.ec/share/native/libsunec/impl/ecdecode.c</b></span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(195, 55,
32); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""><b
class="">---
a/src/jdk.crypto.ec/share/native/libsunec/impl/ecdecode.c</b></span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(52, 188,
38); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""><b
class="">+++
b/src/jdk.crypto.ec/share/native/libsunec/impl/ecdecode.c</b></span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(213, 59,
211); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">@@
-55,6 +55,9 @@</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""> #include
"ecl-curve.h"</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""> #include
"ecc_impl.h"</span></div>
<p style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255); min-height: 13px;" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""> </span><br
class="webkit-block-placeholder">
</p>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(52, 188,
38); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">+#if
EC_DEBUG</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(52, 188,
38); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">+#include
<stdio.h></span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; color: rgb(52, 188,
38); background-color: rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class="">+#endif</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""> #define
MAX_ECKEY_LEN 72</span></div>
<div style="margin: 0px; font-stretch: normal; font-size: 11px;
line-height: normal; font-family: Menlo; background-color:
rgb(255, 255, 255);" class=""><span
style="font-variant-ligatures: no-common-ligatures" class=""> #define
SEC_ASN1_OBJECT_ID 0x06</span></div>
</div>
<div class=""><span style="font-variant-ligatures:
no-common-ligatures" class=""><br class="">
</span></div>
<div class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">In the first file, k1 and k2 are
defined as </span>const mp_int * but mp_tohex accepts a
mp_int* as its 1st argument.</div>
<div class=""><br class="">
</div>
<div class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">In the second file, there is a
printf call in a EC_DEBUG block.</span></div>
<div class=""><span style="font-variant-ligatures:
no-common-ligatures" class=""><br class="">
</span></div>
<div class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">Noreg-cleanup.</span></div>
<div class=""><span style="font-variant-ligatures:
no-common-ligatures" class=""><br class="">
</span></div>
<div class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">Thanks</span></div>
<div class=""><span style="font-variant-ligatures:
no-common-ligatures" class="">Max</span></div>
<div class=""><span style="font-variant-ligatures:
no-common-ligatures" class=""><br class="">
</span></div>
</blockquote>
<br>
</body>
</html>