Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KTCVQ-0003J1-AC for mharc-grub-devel@gnu.org; Wed, 13 Aug 2008 05:19:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTCVN-0003HP-Uo for grub-devel@gnu.org; Wed, 13 Aug 2008 05:18:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTCVL-0003G7-Ow for grub-devel@gnu.org; Wed, 13 Aug 2008 05:18:57 -0400 Received: from [199.232.76.173] (port=39811 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTCVK-0003Fs-O4 for grub-devel@gnu.org; Wed, 13 Aug 2008 05:18:54 -0400 Received: from smtp-vbr17.xs4all.nl ([194.109.24.37]:2099) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTCVK-0000ZG-8b for grub-devel@gnu.org; Wed, 13 Aug 2008 05:18:54 -0400 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr17.xs4all.nl (8.13.8/8.13.8) with ESMTP id m7D9IqXN035046 for ; Wed, 13 Aug 2008 11:18:53 +0200 (CEST) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: Mail-Copies-To: mgerards@xs4all.nl Date: Wed, 13 Aug 2008 11:22:28 +0200 In-Reply-To: (bean123ch@gmail.com's message of "Tue, 12 Aug 2008 10:18:02 +0800") Message-ID: <87y731b76z.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: Idea: implementation of the password command X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2008 09:18:58 -0000 Hi, Bean writes: > First of all, we can store the encrypted password in a variable, like > PASSWORD. It's better to store it in grubenv. as it is more flexible, > and also allows the user to change it from the grub environment. I am not sure if this is what we want. It might be a security risk. > Then, we can add a password hook to normal.mod. Whenever we need > password verification, like before execution of menu or switching to > console mode, we call the hook and check the return value. > > I introduce the attribute list concept in the other post. For example, > we can assign some attribute to a menuitem, one of which is "locked". > If we found this attribute, we call the password hook, otherwise > execute the menu directly. Personally I do not want to limit to passwords only. There might be other ways to authenticate. Perhaps as simple as inserting a card for identification or such. > We can also add a userland command check_password, which check the > password and return true or false. This can be used in script to run > some part of code when password matches. Userland? > Another way for userland interactive is to use variable hook instead > of command. For example, GET_PASSWORD. Whenever its value is query, we > prompt the user for password and return the encrypted value. Here are > some example of its usage: > > # Verify password > if ($PASSWORD = $GET_PASSWORD) then > ... > fi > > # Store the new password > PASSWORD=$GET_PASSWORD > save_env PASSWORD > > This way looks neat, but it requires a working test command to be useful. I think this might become a security risk easily :-/. Although I like exploiting scripting, I prefer to keep security contained to C code. -- Marco