Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Mar 2010 13:44:36 +0100
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Did something in the hashes change from 6 to 8?
Message-ID:  <hmllji$dov$1@dough.gmane.org>
In-Reply-To: <hmjbns$16n2$1@nermal.rz1.convenimus.net>
References:  <hmjbns$16n2$1@nermal.rz1.convenimus.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03/02/10 16:48, Christian Baer wrote:
> Mellow greetings!
>
> On a box running FreeBSD 6.something (probably 6.4) the boot drive died.
> I had never bothered to update it to 7 or 8, since I was planning to
> build a new computer anyway. Since I hadn't done that yet and I still
> needed the work of this machine, I just put in a new drive and installed
> 8.0.
>
> The deal is that a script I restored from backup doesn't quite work as I
> think it should. This is the part that somehow causes problems:
>
>    !/bin/sh
>    stty -echo
>    read -p "Enter passphrase: " passphrase
>    stty echo
>    main=`echo "${passphrase}" | sha256 | cut -c 1-5`
>    if [ "${main}" != "ddfab" ]; then
>      echo "Wrong passphrase!"
>      exit
>    fi
>
> I have typed the password in question about a gazillion times, so I am
> pretty sure I got it right. But somehow the 'if' keeps kicking in.
>
> There are two possible reasons for this:
>
> 1. I have Alzheimer's.
> 2. Something about the way sha256(1) and/or digest(1) or one of the
>     other commands in the script react differenly than before.
>
> Maybe there is another reason that I just don't see?

sha256 and the like cannot change because they are standard algorithms 
and changing them would break a lot of things.

Something else must be the problem. Maybe previous versions got newlines 
in the $passphrase variable or something like that? You will need to 
check output of every step of the script separately.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?hmllji$dov$1>