From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 12682222CF1D5 for ; Wed, 10 Jan 2018 23:26:28 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2018 23:31:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,343,1511856000"; d="scan'208";a="193968140" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 10 Jan 2018 23:31:41 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 10 Jan 2018 23:31:41 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 10 Jan 2018 23:31:40 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Thu, 11 Jan 2018 15:31:37 +0800 From: "Bi, Dandan" To: Atul Gupta , "edk2-devel@lists.01.org" Thread-Topic: VFR validation of IP address and iSCSI IQN Thread-Index: AdOKp25VXWLFkJorTbCeN6qYgusQHQABQzhw Date: Thu, 11 Jan 2018 07:31:37 +0000 Message-ID: <3C0D5C461C9E904E8F62152F6274C0BB3BA0B5F3@shsmsx102.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: VFR validation of IP address and iSCSI IQN X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jan 2018 07:26:29 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, (1) If you want the string can only be set with the one in STR_STRING_CHECK= , you can add following codes within the string opcode:=20 inconsistentif prompt =3D STRING_TOKEN(STR_INVALID_IQN), pushthis !=3D stringref(STRING_TOKEN(STR_STRING_CHECK)) endif; (2) If you want the string only cannot be set with the one in STR_STRING_CH= ECK, you can add following codes within the string opcode: inconsistentif prompt =3D STRING_TOKEN(STR_INVALID_IQN), pushthis =3D=3D stringref(STRING_TOKEN(STR_STRING_CHECK)) endif; For more examples you can refer to the vfr file in: edk2\MdeModulePkg\Unive= rsal\DriverSampleDxe\ Vfr.vfr. Thanks, Dandan -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Atul= Gupta Sent: Thursday, January 11, 2018 2:52 PM To: edk2-devel@lists.01.org Subject: [edk2] VFR validation of IP address and iSCSI IQN Hi, I want to validate IP address and iSCSI IQN within the vfr form. Want to av= oid callback hence removed the INTERACTIVE flags, tried few things but none= seems to work except for input length check, how to validate the input buf= fer. Eg: string name =3D iqn, varid =3D UD_CONFIG_IFR_NVDATA.InitiatorName, prompt =3D STRING_TOKEN(STR_ISCSI_CONFIG_INIT_NAME), help =3D STRING_TOKEN(STR_ISCSI_CONFIG_INIT_NAME_HELP), flags =3D 0, key =3D KEY_INITIATOR_NAME2, minsize =3D 8, maxsize =3D ISCSI_NAME_IFR_MAX_SIZE, inconsistentif prompt =3D STRI= NG_TOKEN(STR_INVALID_IQN), NOT pushthis !=3D stringref(STRING= _TOKEN(STR_STRING_CHECK)) endif endstring; also tried span (flags =3D LAST_NON_MATCH, pushthis, stringref(STRING_TOKEN(STR_STRING= _CHECK)), 0) !=3D 0, but did not help. Any reference to validate the input buffer? Thanks Atul _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel