2013-02-15 2 views
2

Я пишу и iRule для F5 Big-Ip v. 11.x. У меня проблема с библиотекой CRYPTO.Проблема с библиотекой CRYPTO в F5 BIG-IP: отсутствует требуемый параметр

При попытке расшифровать строку таким образом

set foo [CRYPTO::decrypt -alg rc4 -keyhex $key $to_decrypt] 

где $ ключ является строкой в ​​шестнадцатеричном формате и $ to_decrypt является зашифрованная строка.

Я получаю сообщение об ошибке:

tmm err tmm[7107]: 01220001:3: TCL error: /Common/testirule - Missing required parameter

Здесь вы можете найти в документации: https://devcentral.f5.com/wiki/iRules.CRYPTO__decrypt.ashx

Я не могу понять, какой параметр отсутствует, вы можете мне помочь? Заранее спасибо!

редактировать: добавить здесь фрагмент из документации:

CRYPTO::decrypt [-alg <>] [-ctx <> [-final]] [-key[hex] <>] [-iv[hex] <>] []

decrypts data based on several parameters

alg - algorithm. ASCII string from a given list (see below) The spelling is lowercase and the iRule will fail for anything not in the list. In ctx mode, alg must be given in the first CRYPTO::command and cannot be modified. ctx - context is the name of a Tcl variable and can only be generated from and used in CRYPTO commands. Notes: Trying to get or set value for a ctx variable will fail. When a CTX variable is first used in iRule, a tcl object will be generated from the given arguments (alg, key, iv, etc.). A given CTX variable can only be used for one CRYPTO:: command. An iRule CRYPTO:: command would fail if CTX is reused for different purpose. “–final” must be used for the last CRYPTO:: command for the same CTX variable to finish the CRYPTO:: command. After “-final” is used, the CTX variable will be freed and the same ctx variable name can be reused. When a CTX variable already has a key and an IV value stored in it, the value can only be updated before CRYPTO command really starts, that is before any data is given. After the command starts and before it finishes, updating key or IV in CTX would fail. key - key (binary data). Key length is determined by alg used. Can be generated by CRYPTO::keygen keyhex - key as hex data. Key length is determined by alg used. Can be generated by CRYPTO::keygen iv - initialization vector (binary data). Length is determined by alg used. Can be generated by CRYPTO::keygen ivhex - initialization vector as hex data. Length is determined by alg used. Can be generated by CRYPTO::keygen

+0

Для этого сайта требуется логин ... –

+0

Я знаю, к сожалению, я не могу предоставить доступ :(Я добавлю некоторые вещи на вопрос из документации – rikpg

+0

Интересно, требуют ли алгоритм rc4 дополнительные части (т. Е. Дополнительные «дополнительные», такие как '-ctx' или' -iv'). Не знаю точно. –

ответ

1

-iv не является обязательным, потому что вы могли бы создать контекст, содержащий вектор инициализации и передал, что с -ctx вместо этого. Документация по командам TCL не имеет хорошей возможности указать эту ситуацию: -iv и -key обязательны ИЛИ -ctx не требуется.