Skip to content

Commit f69945b

Browse files
committed
JNI: sync WolfCryptError enum with latest wolfSSL error-crypt.h
1 parent 1d24d20 commit f69945b

1 file changed

Lines changed: 144 additions & 8 deletions

File tree

src/main/java/com/wolfssl/wolfcrypt/WolfCryptError.java

Lines changed: 144 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,18 @@ public enum WolfCryptError {
3333

3434
/* error codes match <wolfssl>/wolfssl/wolfcrypt/error-crypt.h */
3535

36-
/** errors -101 - -299 */
37-
MAX_CODE_E (-100),
36+
/** errors -97 - -1008 */
37+
MAX_CODE_E (-96),
38+
39+
/** MP dynamic memory allocation failed */
40+
MP_MEM (-97),
41+
/** MP value passed is not able to be used */
42+
MP_VAL (-98),
43+
/** MP non-blocking returning after partial completion */
44+
MP_WOULDBLOCK (-99),
45+
/** MP point not at infinity */
46+
MP_NOT_INF (-100),
47+
3848
/** opening random device error */
3949
OPEN_RAN_E (-101),
4050
/** reading random device error */
@@ -79,10 +89,21 @@ public enum WolfCryptError {
7989
/** got a mp zero result, not expected */
8090
MP_ZERO_E (-121),
8191

92+
/** AES-EAX Authentication check failure */
93+
AES_EAX_AUTH_E (-122),
94+
/** No longer usable for operation */
95+
KEY_EXHAUSTED_E (-123),
96+
8297
/** out of memory error */
8398
MEMORY_E (-125),
8499
/** var state modified by different thread */
85100
VAR_STATE_CHANGE_E (-126),
101+
/** FIPS Module in degraded mode */
102+
FIPS_DEGRADED_E (-127),
103+
/** Module CODE too big */
104+
FIPS_CODE_SZ_E (-128),
105+
/** Module DATA too big */
106+
FIPS_DATA_SZ_E (-129),
86107

87108
/** RSA wrong block type for RSA function */
88109
RSA_WRONG_TYPE_E (-130),
@@ -143,14 +164,22 @@ public enum WolfCryptError {
143164
ASN_SIG_KEY_E (-157),
144165
/** ASN key init error, invalid input */
145166
ASN_DH_KEY_E (-158),
146-
/** ASN ntru key decode error, invalid input */
147-
ASN_NTRU_KEY_E (-159),
167+
/** SRTP-KDF Known Answer Test Failure */
168+
KDF_SRTP_KAT_FIPS_E (-159),
148169
/** ASN unsupported critical extension */
149170
ASN_CRIT_EXT_E (-160),
150171
/** ASN alternate name error */
151172
ASN_ALT_NAME_E (-161),
152173
/** ASN no PEM header found */
153174
ASN_NO_PEM_HEADER (-162),
175+
/** Ed25519 Known answer test failure */
176+
ED25519_KAT_FIPS_E (-163),
177+
/** Ed448 Known answer test failure */
178+
ED448_KAT_FIPS_E (-164),
179+
/** PBKDF2 Known answer test failure */
180+
PBKDF2_KAT_FIPS_E (-165),
181+
/** Error for private/public key mismatch */
182+
WC_KEY_MISMATCH_E (-166),
154183

155184
/** ECC input argument of wrong type */
156185
ECC_BAD_ARG_E (-170),
@@ -170,6 +199,8 @@ public enum WolfCryptError {
170199
ALT_NAME_E (-177),
171200
/** missing key usage extension */
172201
BAD_OCSP_RESPONDER (-178),
202+
/** CRL date error */
203+
CRL_CERT_DATE_ERR (-179),
173204

174205
/** AES-GCM Authentication check failure */
175206
AES_GCM_AUTH_E (-180),
@@ -290,6 +321,9 @@ public enum WolfCryptError {
290321
/** Hash Type not enabled/available */
291322
HASH_TYPE_E (-232),
292323

324+
/** Invalid FIPS Version defined */
325+
FIPS_INVALID_VER_E (-233),
326+
293327
/** Key size error, either too small or large */
294328
WC_KEY_SIZE_E (-234),
295329
/** ASN Cert Gen, invalid country code size */
@@ -340,15 +374,117 @@ public enum WolfCryptError {
340374
ECDSA_PAT_FIPS_E (-255),
341375
/** DH KAT failure */
342376
DH_KAT_FIPS_E (-256),
343-
377+
/** AESCCM KAT failure */
378+
AESCCM_KAT_FIPS_E (-257),
379+
/** SHA-3 KAT failure */
380+
SHA3_KAT_FIPS_E (-258),
381+
/** ECDHE KAT failure */
382+
ECDHE_KAT_FIPS_E (-259),
383+
/** AES-GCM invocation counter overflow */
384+
AES_GCM_OVERFLOW_E (-260),
385+
/** AES-CCM invocation counter overflow */
386+
AES_CCM_OVERFLOW_E (-261),
387+
/** RSA Key Pair-Wise Consistency check fail */
388+
RSA_KEY_PAIR_E (-262),
389+
/** DH Check Priv Key error */
390+
DH_CHECK_PRIV_E (-263),
391+
/** AF_ALG socket error */
392+
WC_AFALG_SOCK_E (-264),
393+
/** /dev/crypto error */
394+
WC_DEVCRYPTO_E (-265),
395+
/** zlib init error */
396+
ZLIB_INIT_ERROR (-266),
397+
/** zlib compression error */
398+
ZLIB_COMPRESS_ERROR (-267),
399+
/** zlib decompression error */
400+
ZLIB_DECOMPRESS_ERROR (-268),
401+
/** No signer in PKCS#7 signed data msg */
402+
PKCS7_NO_SIGNER_E (-269),
403+
/** PKCS7 operations wants more input */
404+
WC_PKCS7_WANT_READ_E (-270),
405+
/** Crypto callback unavailable */
406+
CRYPTOCB_UNAVAILABLE (-271),
407+
/** Signature needs verified by caller */
408+
PKCS7_SIGNEEDS_CHECK (-272),
409+
/** PSS salt length not recoverable */
410+
PSS_SALTLEN_RECOVER_E (-273),
411+
/** ChaCha20Poly1305 limit overflow */
412+
CHACHA_POLY_OVERFLOW (-274),
413+
/** ASN self-signed certificate error */
414+
ASN_SELF_SIGNED_E (-275),
415+
/** SAKKE derivation verification error */
416+
SAKKE_VERIFY_FAIL_E (-276),
417+
/** IV was not set */
418+
MISSING_IV (-277),
419+
/** Key was not set */
420+
MISSING_KEY (-278),
421+
/** Value of length parameter is invalid */
422+
BAD_LENGTH_E (-279),
423+
/** ECDSA KAT failure */
424+
ECDSA_KAT_FIPS_E (-280),
425+
/** RSA Pairwise failure */
426+
RSA_PAT_FIPS_E (-281),
427+
/** TLS12 KDF KAT failure */
428+
KDF_TLS12_KAT_FIPS_E (-282),
429+
/** TLS13 KDF KAT failure */
430+
KDF_TLS13_KAT_FIPS_E (-283),
431+
/** SSH KDF KAT failure */
432+
KDF_SSH_KAT_FIPS_E (-284),
433+
/** DHE Pairwise Consistency Test failure */
434+
DHE_PCT_E (-285),
435+
/** ECDHE Pairwise Consistency Test failure */
436+
ECC_PCT_E (-286),
344437
/** Cannot export private key */
345438
FIPS_PRIVATE_KEY_LOCKED_E (-287),
439+
/** Protocol callback unavailable */
440+
PROTOCOLCB_UNAVAILABLE (-288),
441+
/** AES-SIV authentication failed */
442+
AES_SIV_AUTH_E (-289),
443+
/** No valid device ID */
444+
NO_VALID_DEVID (-290),
445+
/** Input/output failure */
446+
IO_FAILED_E (-291),
447+
/** System/library call failed */
448+
SYSLIB_FAILED_E (-292),
449+
/** Callback return to indicate HW has PSK */
450+
USE_HW_PSK (-293),
451+
/** Entropy Repetition Test failed */
452+
ENTROPY_RT_E (-294),
453+
/** Entropy Adaptive Proportion Test failed */
454+
ENTROPY_APT_E (-295),
455+
/** Invalid ASN.1 - depth check */
456+
ASN_DEPTH_E (-296),
457+
/** ASN.1 length invalid */
458+
ASN_LEN_E (-297),
459+
/** SM4-GCM Authentication check failure */
460+
SM4_GCM_AUTH_E (-298),
461+
/** SM4-CCM Authentication check failure */
462+
SM4_CCM_AUTH_E (-299),
463+
464+
/** Deadlock averted -- retry the call */
465+
DEADLOCK_AVERTED_E (-1000),
466+
/** ASCON Authentication check failure */
467+
ASCON_AUTH_E (-1001),
468+
/** Crypto acceleration is currently inhibited */
469+
WC_ACCEL_INHIBIT_E (-1002),
470+
/** Bad index */
471+
BAD_INDEX_E (-1003),
472+
/** Process interrupted */
473+
INTERRUPTED_E (-1004),
474+
/** Encoded public key does not match stored hash */
475+
MLKEM_PUB_HASH_E (-1005),
476+
/** Object is busy */
477+
BUSY_E (-1006),
478+
/** Operation was redundant or preempted */
479+
ALREADY_E (-1007),
480+
/** Sequence counter would overflow */
481+
SEQ_OVERFLOW_E (-1008),
346482

347483
/** Update this to indicate last error */
348-
WC_LAST_E (-299),
484+
WC_LAST_E (-1008),
349485

350-
/** errors -101 - -299 */
351-
MIN_CODE_E (-300),
486+
/** Last usable code */
487+
MIN_CODE_E (-1999),
352488

353489
/** OCSP Certificate revoked */
354490
OCSP_CERT_REVOKED (-360),

0 commit comments

Comments
 (0)