Closed kategray closed 4 years ago
The reason is the JCardSim uses a static seed for randomness generated by the RandomData API. I think the main reason is the test reproducibility. One can reseed the generator with another seed.
I noticed that you @kategray already addressed this in the issue https://github.com/licel/jcardsim/issues/139 and created a PR https://github.com/licel/jcardsim/pull/141.
I decided to preserve backward compatibility and created another PR https://github.com/licel/jcardsim/pull/155 which is already merged in my fork https://github.com/ph4r05/jcardsim which is published in the maven repo as 3.0.5.11.
The application works fine, however, when running the unit tests, I get the same result each time:
Looking through the source code, I see that random.generateData is generating into tmpBuffer, then copied into the APDU buffer. As this is part of the process() function (which should be executed separately every time the tests are run), shouldn't the output be random? The implementation in jCardSim seems to be based off bouncycastle, so I would expect it to actually be random.