zeromq/jeromq

ZCertStore's loadFiles recursion logic is incorrect only recursing into first subdir.

ThomasCraigNelson opened this issue · 3 comments

I added a few lines at the bottom of ZCertStoreTest.java's testAddCertificates test to confirm my finding:

    ZCert c3 = new ZCert();
    f = c3.savePublic(CERTSTORE_LOCATION + "qub/c3.cert");
    assertThat(certStore.getCertificatesCount(), is(3));

With these lines the test should pass but it doesn't because only the first directory found is traversed.

The prevents an organization such as storedir/public/cert1 and storedir/private/cert1.

Note also that the java jdk method root.listFiles() is not always going to return the subdirectories in the same order, so with my above organization sometimes it found the public certs when it happened to return that first and things worked, when private was returned first public was ignored and things did not work.

This issue was fixed between 0.5.2 and 0.5.3.

The traverseDirectory code looks better and is different, I'm using 0.5.2. In addition my test was bogus it should be "/qub/c3.cert" and that passes on 0.5.3. When is 0.5.3 going to be available on maven central?

We're in the process of working on deploying a new stable build to central. I suspect this will happen before Friday

I just issued a new stable release today. It'll take some time for the mirrors to update on maven central.