Commit 24b82d7c authored by berge's avatar berge
Browse files

Fixed keyLen checking functions

parent 3fa3c092
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1074,19 +1074,16 @@ group rfc4303Esp_ExtHdrFunctions {
		if( (f_getEncryptionIvLen(PX_ENCRYPTION_ALGO) != 0) and (f_getEncryptionIvLen(PX_ENCRYPTION_ALGO) != lengthof(PX_IV))) {
			v_ret := e_error;
			log("**** fx_setSecurityParameters: ERROR: Incorrect IV length for the selected encryption algorithm ****");
			return;
		}

		if( f_checkEncryptionKeyLen(PX_ENCRYPTION_ALGO,lengthof(PX_ESP_ENCR_KEY))) {
		if( f_checkEncryptionKeyLen(PX_ENCRYPTION_ALGO,lengthof(PX_ESP_ENCR_KEY)) != true) {
			v_ret := e_error;
			log("**** fx_setSecurityParameters: ERROR: Incorrect key length for the selected encryption algorithm ****");
			return;
		}

		if( f_checkIntegrityKeyLen(PX_INTEGRITY_ALGO, lengthof(PX_INTEGRITY_KEY))) {
		if( f_checkIntegrityKeyLen(PX_INTEGRITY_ALGO, lengthof(PX_INTEGRITY_KEY)) != true) {
			v_ret := e_error;
			log("**** fx_setSecurityParameters: ERROR: Incorrect key length for the selected integrity algorithm ****");
			return;
		}

		vc_sad[0] := {