Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90940482
20140218.passwords.4.vcs.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 6, 05:51
Size
728 B
Mime Type
text/x-php
Expires
Fri, Nov 8, 05:51 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22164058
Attached To
rPH Phabricator
20140218.passwords.4.vcs.php
View Options
<?php
$table
=
new
PhabricatorRepositoryVCSPassword
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
echo
pht
(
'Upgrading password hashing for VCS passwords.'
).
"
\n
"
;
$best_hasher
=
PhabricatorPasswordHasher
::
getBestHasher
();
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$password
)
{
$id
=
$password
->
getID
();
echo
pht
(
'Migrating VCS password %d...'
,
$id
).
"
\n
"
;
$input_hash
=
$password
->
getPasswordHash
();
$input_envelope
=
new
PhutilOpaqueEnvelope
(
$input_hash
);
$storage_hash
=
$best_hasher
->
getPasswordHashForStorage
(
$input_envelope
);
queryfx
(
$conn_w
,
'UPDATE %T SET passwordHash = %s WHERE id = %d'
,
$table
->
getTableName
(),
$storage_hash
->
openEnvelope
(),
$id
);
}
echo
pht
(
'Done.'
).
"
\n
"
;
Event Timeline
Log In to Comment