Thanks Luis.
Sorry for not providing the additional info in the first post.
> 1) Are you accessing the records created from the mac? Or you're re-
> creating it from scratch? Are you pulling it from an existing
> database?
I am accessing records created from the Mac and Windows and the
results are the same regardless of which source creates them.
Examples:
created on a mac, read on a mac:
=> #<User id: 1068138635, login: "umac", crypted_password:
"1f305dba421a8b5b789f83fe20427115e081528f", salt:
"e9517ee84c0a3945ac07ff59b323f2356b1405d1", email_address:
"[email protected]", created_at: "2011-07-13 15:51:10", updated_at:
"2011-07-13 15:51:10", first_name: "user", last_name: "created on
mac">
created on a mac, read on a pc:
irb(main):001:0> @u=User.find(:first, :conditions=>["login = ?",
"umac"])
=> #<User id: 1068138635, login: "umac", crypted_password:
"1f305dba421a8b5b789f83fe20427115e081528\x00\x00", salt:
"e9517ee84c0a3945ac07ff59b323f2356b1405d\x00\x00"
, email_address: "[email protected]", created_at: "2011-07-13 15:51:10",
updated_at: "2011-07-13 15:51:10", first_name: "user", last_name:
"created on mac">

created on a pc, read on a mac:
ruby-1.9.2-p180 :003 > @u=User.find(:first, :conditions=>["login = ?",
"userpc"])
 => #<User id: 1068138636, login: "userpc", crypted_password:
"51aa6cba52ed4c5b40da4aad9a66c2082b7cf3f9", salt:
"a1d3bc09a0df6cc8a548f8ac8ada5f272d8ab127", email_address:
"[email protected]", created_at: "2011-07-13 19:34:27", updated_at:
"2011-07-13 19:34:27", first_name: "user", last_name: "createdonapc">
created on a pc, read on a pc:
irb(main):002:0> @u=User.find(:first, :conditions=>["login = ?",
"userpc"])
=> #<User id: 1068138636, login: "userpc", crypted_password:
"51aa6cba52ed4c5b40da4aad9a66c2082b7cf3f\x00\x00", salt:
"a1d3bc09a0df6cc8a548f8ac8ada5f272d8ab12\x00\x00",
email_address: "[email protected]", created_at: "2011-07-13 19:34:27",
updated_at: "2011-07-13 19:34:27", first_name: "user", last_name:
"createdonapc">
I am creating them from scratch and using a newly created database for
this app and Rails 3.0+


2) Can you tell us what version of Ruby *and* version of OpenSSL are
> you using in both environments? E.g.:

Mac:
Ruby 1.9.2 and Rails 3.0.6,OpenSSL 0.9.8l 5 Nov 2009
PC:
Ruby 1.9.2 and Rails 3.0.6,OpenSSL 0.9.8q 2 Dec 2010

3) What "Digest::SHA1.hexdigest("something")" returns to you?
Mac:

ruby -rdigest/sha1 -e 'puts
Digest::SHA1.hexdigest("something").inspect'
"1af17e73721dbe0c40011b82ed4bb1a7dbe3ce29"

PC:
ruby -rdigest/sha1 -e 'puts
Digest::SHA1.hexdigest("something").inspect'
"1af17e73721dbe0c40011b82ed4bb1a7dbe3ce29"

> 3) Have you tried doing chomp to remove the trail garbage?
No because the problem is not that the garbage is there but the
\x00\x00 actually replaces the last character in a valid salt.

Thanks for spending your time to look at this.
Tom

On Jul 13, 10:34 am, Luis Lavena <[email protected]> wrote:
> On Jul 12, 4:18 pm, Tom <[email protected]> wrote:
>
>
>
>
>
>
>
>
>
> > peruse the following:
>
> > Mac version
> > ruby-1.9.2-p180 :005 > @u=User.find(:first, :conditions=>["login = ?",
> > "rgtest"])
> >  => #<User id: 1068138631, login: "rgtest", crypted_password:
> > "a13970eb729c1f0761242f1995a2d2f7b2e52e5a", salt:
> > "122a37f8c048d7eacb8d62008790be7406c85cdc", email_address: "rgtest",
> > created_at: "2011-07-12 12:03:20", updated_at: "2011-07-12 18:30:08",
> > first_name: "rgtest", last_name: "rgtest">
>
> > Windows Version
> > irb(main):001:0> @u=User.find(:first, :conditions=>["login = ?",
> > "rgtest"])
> > => #<User id: 1068138631, login: "rgtest", crypted_password:
> > "a13970eb729c1f0761242f1995a2d2f7b2e52e5\x00\x00", salt:
> > "122a37f8c048d7eacb8d62008790be7406c85cd\x00\x00", email_address:
> > "rgtest", created_at: "2011-07-12 12:03:20", updated_at: "2011-07-12
> > 18:30:08", first_name: "rgtest", last_name: "rgtest">
> > irb(main):002:0>
>
> Questions:
>
> 1) Are you accessing the records created from the mac? Or you're re-
> creating it from scratch? Are you pulling it from an existing
> database?
>
> 2) Can you tell us what version of Ruby *and* version of OpenSSL are
> you using in both environments? E.g.:
>
> $ ruby -v
> ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.6.0]
>
> $ ruby -ropenssl -e "puts OpenSSL::OPENSSL_VERSION"
> OpenSSL 0.9.8l 5 Nov 2009
>
> 3) What "Digest::SHA1.hexdigest("something")" returns to you?
>
> $ ruby -rdigest/sha1 -e 'puts
> Digest::SHA1.hexdigest("something").inspect'
> "1af17e73721dbe0c40011b82ed4bb1a7dbe3ce29"
>
> Do you see the trailing garbage there?
>
> 3) Have you tried doing chomp to remove the trail garbage?
>
> --
> Luis Lavena

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to