Closed Bug 278792 Opened 20 years ago Closed 20 years ago

Move Crypt() to Bugzilla::Auth

Categories

(Bugzilla :: Bugzilla-General, enhancement)

2.19.2
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: mkanat, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

The Crypt() function from globals.pl should be easily moveable to Bugzilla::Util.
Severity: normal → enhancement
I'm also going to rename it to bz_crypt, becase:

+ Bugzilla::Util functions are all lowercase.
+ There's already a "crypt" function in perl.
+ Having a function that differs from a builtin only by a capital letter is 
  probably not as good as having the bz_ prefix on there.
OK, actually, it should go to Bugzilla::Auth, since that's where it really belongs.

This is determined by a comment in checksetup:

# The only use for loading globals.pl is for Crypt(), which should at some
# point probably be factored out into Bugzilla::Auth::*

I'll also re-name it to crypt_new_password, since that makes more sense, and
more clearly indicates what it does.
Status: NEW → ASSIGNED
Summary: Move Crypt to Bugzilla::Util → Move Crypt() to Bugzilla::Auth::crypt_new_password
Attached patch Move Crypt() (obsolete) — Splinter Review
OK, here it is. I didn't want to also remove globals.pl from checksetup in the
same patch; we can file a new bug to do that.
Attachment #171596 - Flags: review?
Blocks: 280124
I'm probably missing something here, but what does "new" mean from the
"crypt_new_password" thing?

As far as I can see from the code, the sub takes a password, crypts it, and
returns the result. There is no "new password" generated or something like that.
It's because it's only for crypting a password that's a *new* password for the
user. You can't use it to re-crypt the password later, to check against the
crypted version. It will return something different every time you pass it the
same string.
Comment on attachment 171596 [details] [diff] [review]
Move Crypt()

Oh. Well that's what crypt from the Perl distribution does by default, and it's
not named crypt_new.

In my opinion it's not a new password, it's the same password, in its crypted
form. It's similar to the MD5 of the password. I wouldn't call that a new
password.

So I think this is bad terminology for some developers, including me.
Attachment #171596 - Flags: review? → review-
Summary: Move Crypt() to Bugzilla::Auth::crypt_new_password → Move Crypt() to Bugzilla::Auth
Target Milestone: --- → Bugzilla 2.20
OK. I'll call it bz_crypt_password.
Attached patch Version 2Splinter Review
OK. I named it bz_crypt. I figure that's simple enough. I also improved the
documentation, slightly, and used a better way of calling Exporter.
Attachment #171596 - Attachment is obsolete: true
Attachment #172773 - Flags: review?
Attachment #172773 - Flags: review? → review+
Flags: approval?
Flags: approval? → approval+
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.333; previous revision: 1.332
done
Checking in editusers.cgi;
/cvsroot/mozilla/webtools/bugzilla/editusers.cgi,v  <--  editusers.cgi
new revision: 1.72; previous revision: 1.71
done
Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v  <--  globals.pl
new revision: 1.291; previous revision: 1.290
done
Checking in token.cgi;
/cvsroot/mozilla/webtools/bugzilla/token.cgi,v  <--  token.cgi
new revision: 1.28; previous revision: 1.27
done
Checking in userprefs.cgi;
/cvsroot/mozilla/webtools/bugzilla/userprefs.cgi,v  <--  userprefs.cgi
new revision: 1.63; previous revision: 1.62
done
Checking in Bugzilla/Auth.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Auth.pm,v  <--  Auth.pm
new revision: 1.8; previous revision: 1.7
done
Checking in Bugzilla/Auth/Verify/DB.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/DB.pm,v  <--  DB.pm
new revision: 1.4; previous revision: 1.3
done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: