Last modified: 2013-04-25 11:53:43 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 42054 - ClickTracking: Don't use deprecated wfGenerateToken()
ClickTracking: Don't use deprecated wfGenerateToken()
Product: MediaWiki extensions
Classification: Unclassified
ClickTracking (Other open bugs)
All All
: Lowest trivial (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: code_quality
  Show dependency treegraph
Reported: 2012-11-12 21:55 UTC by Alex Monk
Modified: 2013-04-25 11:53 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Alex Monk 2012-11-12 21:55:36 UTC
I've been seeing this notice on my dev/test wiki:

Deprecated:  Use of wfGenerateToken was deprecated in MediaWiki 1.20. [Called from ClickTrackingHooks::makeGlobalVariablesScript in /var/www/MediaWiki/Git/extensions/ClickTracking/ClickTracking.hooks.php at line 77] in /var/www/MediaWiki/Git/core/includes/debug/Debug.php on line 283

No idea how to correctly fix this, so I thought I'd put it here.
Comment 1 Daniel Friesen 2012-11-12 22:07:19 UTC
"@deprecated since 1.20; Please use MWCryptRand for security purposes and wfRandomString for pesudo-random strings"

wfGenerateToken was an unacceptable mess. It was used both for security purposes and trivial pesudo-random tokens as well. It claimed to be cryptographically secure but it used nothing more than one or two insecure calls to mt_rand. 

So, MWCryptRand if you are making tokens that need to be secure; Session tokens, user tokens, email confirmation tokens, etc... basically anything where it's possible it might matter that someone else could guess it.
And a new function, wfRandomString for simple random semi-unique strings. Such as UNIQ ids like those used in the parser.
Comment 2 Andre Klapper 2013-04-12 11:11:28 UTC
WONTFIX as per ?
Comment 3 Andre Klapper 2013-04-25 11:53:43 UTC
I assume so.

Note You need to log in before you can comment on or make changes to this bug.