Hi Marek,

I do the following:

static char *login="login";
static char *password="password";
static char *label="label";

const unsigned char *buf=NULL;
strcat(&buf, login); strcat(&buf, password); strcat(&buf, label);

unsigned char *m1[20];
unsigned char *m2[20];

SHA1(&buf, strlen(&buf), m1); // The output is:
3d79ad220830e96dabd6ae6f9973306df1800906

//the output of the above SHA1 will be used as an input for the SHA1
below, after concatenating it with label

strcat(&m1, label);
SHA1(&m1, str len(&m1), m2);

I don't know why the output of the second SHA1 is not the same when I
run the program several times. But I think the problem is in the m1
storing, but I don't know how to resolve that.

Thanks,
Best regards,

On Fri, Apr 11, 2008 at 12:46 PM,  <[EMAIL PROTECTED]> wrote:
> Hello,
>
> [EMAIL PROTECTED] wrote on 04/11/2008 03:51:18 AM:
>
>
> > Dear all,
> >
> > I need to call the hash function two times, in which the output of the
> > first call is used as an input for the second (result = hash[hash(A
> > +B) + C]
> >
> > The first call is ok, but when I concatenate its output to the C, I
> > don't get the expected output.
> >
> > Did I miss something?
> Expression above looks good, but there is too little information
> of real implementation to say something reasonable.
>
> Best regards,
> --
> Marek Marcola <[EMAIL PROTECTED]>
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           [EMAIL PROTECTED]
>



-- 
Badra
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to