Skip to content

RandomIdGenerator is not thread safe #18

@serac

Description

@serac

IdGenerators are intended to be thread safe, yet this component is not due to the use of org.bouncycastle.crypto.prng.drbg.HashSP800DRBG, which is not thread safe. Errors like the following may arise under moderate concurrency:

Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
    at org.bouncycastle.crypto.digests.GeneralDigest.update(Unknown Source)
    at org.bouncycastle.crypto.digests.GeneralDigest.update(Unknown Source)
    at org.bouncycastle.crypto.prng.drbg.HashSP800DRBG.doHash(Unknown Source)
    at org.bouncycastle.crypto.prng.drbg.HashSP800DRBG.hashgen(Unknown Source)
    at org.bouncycastle.crypto.prng.drbg.HashSP800DRBG.generate(Unknown Source)
    at org.cryptacular.generator.RandomIdGenerator.generate(RandomIdGenerator.java:69)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions