Skip to content

Commit

Permalink
Document lack of thread-safety
Browse files Browse the repository at this point in the history
  • Loading branch information
pushkarnk committed Sep 3, 2024
1 parent ee026fe commit 7d5888b
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/com/canonical/openssl/cipher/OpenSSLCipher.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.BadPaddingException;

/* This implementation will be exercised by the user through the
* javax.crypto.Cipher API which isn't marked thread-safe.
* This implementation is also NOT thread-safe and applications need
* handle thread-safety concerns if need be.
*/

abstract public class OpenSSLCipher extends CipherSpi {

static {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/canonical/openssl/kdf/OpenSSLPBKDF2.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
* can be represented by class PBEKeySpec. As a result, only PBKDF2
* is implemented in this prototype.
*/

/* This implementation will be exercised by the user through the
* javax.crypto.SecretKeyFactory API which isn't marked thread-safe.
* This implementation is also NOT thread-safe and applications need
* handle any concerns regarding the same.
*/
public class OpenSSLPBKDF2 extends SecretKeyFactorySpi {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
import javax.crypto.SecretKey;
import java.util.Base64;

/* This implementation will be exercised by the user through the
* javax.crypto.KeyAgreement API which isn't marked thread-safe.
* This implementation is also NOT thread-safe and applications need
* handle thread-safety concerns if need be.
*/

abstract public class OpenSSLKeyAgreement extends KeyAgreementSpi {
static {
NativeLibraryLoader.load();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
import java.security.interfaces.RSAPublicKey;
import javax.crypto.spec.SecretKeySpec;

/* This implementation will be exercised by the user through the
* javax.crypto.KEM API which isn't marked thread-safe.
* This implementation is also NOT thread-safe and applications need
* handle thread-safety concerns if need be.
*/

final public class OpenSSLKEMRSA implements KEMSpi {

static {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/canonical/openssl/mac/OpenSSLMAC.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
import java.security.spec.AlgorithmParameterSpec;
import javax.xml.crypto.dsig.spec.HMACParameterSpec;

/* This implementation will be exercised by the user through the
* javax.crypto.Mac API which isn't marked thread-safe.
* This implementation is also NOT thread-safe and applications need
* handle thread-safety concerns if need be.
*/

public abstract class OpenSSLMAC extends MacSpi {

static {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/canonical/openssl/md/OpenSSLMD.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
import java.util.Arrays;
import java.util.Set;

/* This implementation will be exercised by the user through the
* java.security.MessageDigest API which isn't marked thread-safe.
* This implementation is also NOT thread-safe and applications need
* handle thread-safety concerns if need be.
*/
public abstract class OpenSSLMD extends MessageDigestSpi {

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
import java.security.SignatureException;
import java.security.SignatureSpi;

/* This implementation will be exercised by the user through the
* java.security.Signature API which isn't marked thread-safe.
* This implementation is also NOT thread-safe and applications need
* handle thread-safety concerns if need be.
*/
public abstract class OpenSSLSignature extends SignatureSpi {

static {
Expand Down

0 comments on commit 7d5888b

Please sign in to comment.