diff --git a/lang_helpers/gds_codes.ftn b/lang_helpers/gds_codes.ftn index f87f64aa17..3b76cf2022 100644 --- a/lang_helpers/gds_codes.ftn +++ b/lang_helpers/gds_codes.ftn @@ -1958,6 +1958,8 @@ C -- PARAMETER (GDS__ses_reset_failed = 335545272) INTEGER*4 GDS__block_size PARAMETER (GDS__block_size = 335545273) + INTEGER*4 GDS__tom_key_length + PARAMETER (GDS__tom_key_length = 335545274) INTEGER*4 GDS__gfix_db_name PARAMETER (GDS__gfix_db_name = 335740929) INTEGER*4 GDS__gfix_invalid_sw diff --git a/lang_helpers/gds_codes.pas b/lang_helpers/gds_codes.pas index 107c51496e..caec441686 100644 --- a/lang_helpers/gds_codes.pas +++ b/lang_helpers/gds_codes.pas @@ -1953,6 +1953,8 @@ const gds_ses_reset_failed = 335545272; isc_block_size = 335545273; gds_block_size = 335545273; + isc_tom_key_length = 335545274; + gds_tom_key_length = 335545274; isc_gfix_db_name = 335740929; gds_gfix_db_name = 335740929; isc_gfix_invalid_sw = 335740930; diff --git a/src/include/gen/Firebird.pas b/src/include/gen/Firebird.pas index ba63ae2f88..8e684c3388 100644 --- a/src/include/gen/Firebird.pas +++ b/src/include/gen/Firebird.pas @@ -5076,6 +5076,7 @@ const isc_repl_error = 335545271; isc_ses_reset_failed = 335545272; isc_block_size = 335545273; + isc_tom_key_length = 335545274; isc_gfix_db_name = 335740929; isc_gfix_invalid_sw = 335740930; isc_gfix_incmp_sw = 335740932; diff --git a/src/include/gen/codetext.h b/src/include/gen/codetext.h index 14424f4daf..3d8a8cd106 100644 --- a/src/include/gen/codetext.h +++ b/src/include/gen/codetext.h @@ -975,6 +975,7 @@ static const struct { {"repl_error", 335545271}, {"ses_reset_failed", 335545272}, {"block_size", 335545273}, + {"tom_key_length", 335545274}, {"gfix_db_name", 335740929}, {"gfix_invalid_sw", 335740930}, {"gfix_incmp_sw", 335740932}, diff --git a/src/include/gen/iberror.h b/src/include/gen/iberror.h index 0e7fd41366..37b36bc641 100644 --- a/src/include/gen/iberror.h +++ b/src/include/gen/iberror.h @@ -1009,6 +1009,7 @@ const ISC_STATUS isc_wrong_page = 335545270L; const ISC_STATUS isc_repl_error = 335545271L; const ISC_STATUS isc_ses_reset_failed = 335545272L; const ISC_STATUS isc_block_size = 335545273L; +const ISC_STATUS isc_tom_key_length = 335545274L; const ISC_STATUS isc_gfix_db_name = 335740929L; const ISC_STATUS isc_gfix_invalid_sw = 335740930L; const ISC_STATUS isc_gfix_incmp_sw = 335740932L; @@ -1501,7 +1502,7 @@ const ISC_STATUS isc_trace_switch_user_only = 337182757L; const ISC_STATUS isc_trace_switch_param_miss = 337182758L; const ISC_STATUS isc_trace_param_act_notcompat = 337182759L; const ISC_STATUS isc_trace_mandatory_switch_miss = 337182760L; -const ISC_STATUS isc_err_max = 1445; +const ISC_STATUS isc_err_max = 1446; #else /* c definitions */ @@ -2480,6 +2481,7 @@ const ISC_STATUS isc_err_max = 1445; #define isc_repl_error 335545271L #define isc_ses_reset_failed 335545272L #define isc_block_size 335545273L +#define isc_tom_key_length 335545274L #define isc_gfix_db_name 335740929L #define isc_gfix_invalid_sw 335740930L #define isc_gfix_incmp_sw 335740932L @@ -2972,7 +2974,7 @@ const ISC_STATUS isc_err_max = 1445; #define isc_trace_switch_param_miss 337182758L #define isc_trace_param_act_notcompat 337182759L #define isc_trace_mandatory_switch_miss 337182760L -#define isc_err_max 1445 +#define isc_err_max 1446 #endif diff --git a/src/include/gen/msgs.h b/src/include/gen/msgs.h index 65d3caa2b9..0051c94076 100644 --- a/src/include/gen/msgs.h +++ b/src/include/gen/msgs.h @@ -978,6 +978,7 @@ Data source : @4"}, /* eds_statement */ {335545271, "Replication error"}, /* repl_error */ {335545272, "Reset of user session failed. Connection is shut down."}, /* ses_reset_failed */ {335545273, "File size is less than expected"}, /* block_size */ + {335545274, "Invalid key length @1, need >@2"}, /* tom_key_length */ {335740929, "data base file name (@1) already given"}, /* gfix_db_name */ {335740930, "invalid switch @1"}, /* gfix_invalid_sw */ {335740932, "incompatible switch combination"}, /* gfix_incmp_sw */ diff --git a/src/include/gen/sql_code.h b/src/include/gen/sql_code.h index 6eb004667c..7910b01957 100644 --- a/src/include/gen/sql_code.h +++ b/src/include/gen/sql_code.h @@ -974,6 +974,7 @@ static const struct { {335545271, -902}, /* 951 repl_error */ {335545272, -902}, /* 952 ses_reset_failed */ {335545273, -902}, /* 953 block_size */ + {335545274, -901}, /* 954 tom_key_length */ {335740929, -901}, /* 1 gfix_db_name */ {335740930, -901}, /* 2 gfix_invalid_sw */ {335740932, -901}, /* 4 gfix_incmp_sw */ diff --git a/src/include/gen/sql_state.h b/src/include/gen/sql_state.h index bee9f7cefb..71e8871545 100644 --- a/src/include/gen/sql_state.h +++ b/src/include/gen/sql_state.h @@ -974,6 +974,7 @@ static const struct { {335545271, "HY000"}, // 951 repl_error {335545272, "08003"}, // 952 ses_reset_failed {335545273, "XX000"}, // 953 block_size + {335545274, "22023"}, // 954 tom_key_length {335740929, "00000"}, // 1 gfix_db_name {335740930, "00000"}, // 2 gfix_invalid_sw {335740932, "00000"}, // 4 gfix_incmp_sw diff --git a/src/jrd/SysFunction.cpp b/src/jrd/SysFunction.cpp index 1edfc45383..8f1a970d54 100644 --- a/src/jrd/SysFunction.cpp +++ b/src/jrd/SysFunction.cpp @@ -3103,6 +3103,8 @@ dsc* evlEncryptDecrypt(thread_db* tdbb, const SysFunction* function, const NestV { case ALG_RC4: { + if (key.getCount() < 5) // 40 bit - constant from tomcrypt + (Arg::Gds(isc_tom_key_length) << Arg::Num(key.getCount()) << Arg::Num(4)).raise(); rc4_state rc4; tomCheck(rc4_stream_setup(&rc4, key.begin(), key.getCount()), Arg::Gds(isc_tom_init_cip) << "RC4"); @@ -3153,6 +3155,8 @@ dsc* evlEncryptDecrypt(thread_db* tdbb, const SysFunction* function, const NestV case ALG_SOBER: { + if (key.getCount() < 4) // 4, 8, 12, ... + (Arg::Gds(isc_tom_key_length) << Arg::Num(key.getCount()) << Arg::Num(3)).raise(); sober128_state sober128; tomCheck(sober128_stream_setup(&sober128, key.begin(), key.getCount()), Arg::Gds(isc_tom_init_cip) << "SOBER-128"); tomCheck(sober128_stream_setiv(&sober128, iv.begin(), iv.getCount()), Arg::Gds(isc_tom_setup_cip) << "SOBER-128"); diff --git a/src/msgs/facilities2.sql b/src/msgs/facilities2.sql index 00b10036da..c6b9436ae9 100644 --- a/src/msgs/facilities2.sql +++ b/src/msgs/facilities2.sql @@ -1,7 +1,7 @@ /* MAX_NUMBER is the next number to be used, always one more than the highest message number. */ set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES (?, ?, ?, ?); -- -('2021-03-18 11:20:00', 'JRD', 0, 954) +('2021-05-11 14:10:00', 'JRD', 0, 955) ('2015-03-17 18:33:00', 'QLI', 1, 533) ('2018-03-17 12:00:00', 'GFIX', 3, 136) ('1996-11-07 13:39:40', 'GPRE', 4, 1) diff --git a/src/msgs/messages2.sql b/src/msgs/messages2.sql index 9306bcfb38..8c72ea3aa9 100644 --- a/src/msgs/messages2.sql +++ b/src/msgs/messages2.sql @@ -1061,6 +1061,7 @@ Data source : @4', NULL, NULL) ('repl_error', 'checkStatus', 'Publisher.cpp', NULL, 0, 951, NULL, 'Replication error', NULL, NULL); ('ses_reset_failed', NULL, 'Attachment.cpp', NULL, 0, 952, NULL, 'Reset of user session failed. Connection is shut down.', NULL, NULL); ('block_size', NULL, 'unix.cpp', NULL, 0, 953, NULL, 'File size is less than expected', NULL, NULL); +('tom_key_length', NULL, 'SysFunction.cpp', NULL, 0, 954, NULL, 'Invalid key length @1, need >@2', NULL, NULL); -- QLI (NULL, NULL, NULL, NULL, 1, 0, NULL, 'expected type', NULL, NULL); (NULL, NULL, NULL, NULL, 1, 1, NULL, 'bad block type', NULL, NULL); diff --git a/src/msgs/system_errors2.sql b/src/msgs/system_errors2.sql index c594b75076..6a34559c91 100644 --- a/src/msgs/system_errors2.sql +++ b/src/msgs/system_errors2.sql @@ -960,6 +960,7 @@ set bulk_insert INSERT INTO SYSTEM_ERRORS (SQL_CODE, SQL_CLASS, SQL_SUBCLASS, FA (-902, 'HY', '000', 0, 951, 'repl_error', NULL, NULL) (-902, '08', '003', 0, 952, 'ses_reset_failed', NULL, NULL) (-902, 'XX', '000', 0, 953, 'block_size', NULL, NULL) +(-901, '22', '023', 0, 954, 'tom_key_length', NULL, NULL) -- GFIX (-901, '00', '000', 3, 1, 'gfix_db_name', NULL, NULL) (-901, '00', '000', 3, 2, 'gfix_invalid_sw', NULL, NULL)