<div dir="ltr">Hi Max,<div><br></div><div>Thanks for your time and review.</div><div><br></div><div>Test refactorings look good to me :-)</div><div><br></div><div>In regard to <span style="font-size:12.8px">pkcs11.txt, we are currently using the cfg file to store configuration information (as before). I suggest to keep using it to leverage on previous work. The only change we are actually doing to configuration information is the "sql:/" prefix on the db path (to indicate a sqllite db).</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Kind regards,</span></div><div><span style="font-size:12.8px">Martin.-</span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 11, 2017 at 11:40 AM, Weijun Wang <span dir="ltr"><<a href="mailto:weijun.wang@oracle.com" target="_blank">weijun.wang@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Martin<br>
<br>
Your src change looks fine, and if you think my test update is good, I can push the changeset.<br>
<br>
Still, I need one confirmation. The modutil man page has "modutil supports two types of databases: the legacy security<br>
databases (cert8.db, key3.db, and secmod.db) and new SQLite databases (cert9.db, key4.db, and pkcs11.txt)". So it looks like the pkcs11.txt file is optional?<br>
<br>
Thanks<br>
Max<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
> On Dec 11, 2017, at 11:16 AM, Weijun Wang <<a href="mailto:weijun.wang@oracle.com">weijun.wang@oracle.com</a>> wrote:<br>
><br>
><br>
><br>
>> On Dec 8, 2017, at 4:55 PM, Weijun Wang <<a href="mailto:weijun.wang@oracle.com">weijun.wang@oracle.com</a>> wrote:<br>
>><br>
>> Hi Martin<br>
>><br>
>> I've made some change and post a new webrev at<br>
>><br>
>> <a href="http://cr.openjdk.java.net/~weijun/8165996/webrev.00/" rel="noreferrer" target="_blank">http://cr.openjdk.java.net/~<wbr>weijun/8165996/webrev.00/</a><br>
><br>
> More change in the same URL.<br>
><br>
> - key4.db and cert9.db are saved in Secmod.<br>
><br>
> - I modified the existing PKCS11Test/SecmodTest to load sqlite based dbs.<br>
><br>
> Thanks<br>
> Max<br>
><br>
>><br>
>> The src part is unchanged. Major changes to test are:<br>
>><br>
>> 1. PKCS11Test.getNSSLibDir() is used to get the NSS lib dir. Honestly this is my 1st time touching NSS so hopefully it's not wrong.<br>
>><br>
>> 2. I didn't used your private key and certs. Instead, an internal class CertAndKeyGen is used.<br>
>><br>
>> 3. I've saved "key4.db" and "cert9.db" as real files inside nss/sqlite. I know binary files are extremely unwelcome in an open source project, but maybe this time this is acceptable. We already have nss/db and nss/sqlite is certainly not worse, and maybe we can write more test using this backend later.<br>
>><br>
>> 4. I also moved "nssdbsqlite" from /tmp to the current working directory. For jtreg, cwd is always empty and will be cleaned/retained after a test run. More importantly, no two test runs will use the same cwd.<br>
>><br>
>> So nothing really changed. I still need to read about sql:/ to understand the src fix.<br>
>><br>
>> Thanks<br>
>> Max<br>
>><br>
>>> On Dec 8, 2017, at 2:33 PM, Weijun Wang <<a href="mailto:weijun.wang@oracle.com">weijun.wang@oracle.com</a>> wrote:<br>
>>><br>
>>> Hi Martin<br>
>>><br>
>>> I'm just starting to read this patch. Two questions:<br>
>>><br>
>>> 1. Is there a webpage on configDir using sql:/?<br>
>>><br>
>>> 2. Your test hardcoded nssLibraryDirectory to be "/lib64". It would need to be changed to either those inclosed the repository (macOS and Windows) or in the system (others). Is there a version requirement?<br>
>>><br>
>>> 3. The test contains a lot of binary data. Can you describe more clearly on which is from where? Especially key4Content and cert9Content? In fact, can they be recreated from the existing file based db inside test/jdk/sun/security/pkcs11/<wbr>nss/db? If yes, the test will be much shorter. Please at least use multiple lines for the 2 keys.<br>
>>><br>
>>> Thanks<br>
>>> Max<br>
>>><br>
>>>> On Nov 29, 2017, at 10:11 PM, Martin Balao <<a href="mailto:mbalao@redhat.com">mbalao@redhat.com</a>> wrote:<br>
>>>><br>
>>>> Hi,<br>
>>>><br>
>>>> I'd like to propose a fix for JDK-8165996 - PKCS11 using NSS throws an error regarding secmod.db when NSS uses sqlite [1].<br>
>>>><br>
>>>> Webrev01:<br>
>>>><br>
>>>> * <a href="http://cr.openjdk.java.net/~akasko/mbalao/8165996.webrev.01/" rel="noreferrer" target="_blank">http://cr.openjdk.java.net/~<wbr>akasko/mbalao/8165996.webrev.<wbr>01/</a> (browse online)<br>
>>>> * <a href="http://cr.openjdk.java.net/~akasko/mbalao/8165996.webrev.01.zip" rel="noreferrer" target="_blank">http://cr.openjdk.java.net/~<wbr>akasko/mbalao/8165996.webrev.<wbr>01.zip</a> (download)<br>
>>>><br>
>>>> Kind regards,<br>
>>>> Martin.-<br>
>>>><br>
>>>> --<br>
>>>> [1] - <a href="https://bugs.openjdk.java.net/browse/JDK-8165996" rel="noreferrer" target="_blank">https://bugs.openjdk.java.net/<wbr>browse/JDK-8165996</a><br>
>>><br>
>><br>
><br>
<br>
</div></div></blockquote></div><br></div>