Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12239 closed enhancement (fixed)

Replace fcrypt dependency with passlib

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.2
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Replaced fcrypt dependency with passlib.

API Changes:
Internal Changes:

Description

Trac has a dependency on fcrypt when running on non-Unix platforms.

$grep -R "fcrypt" . --exclude-dir=".git" --exclude-dir=".svn" --exclude=*.pyc --exclude-dir=build --exclude-dir=doc
./contrib/htpasswd.py:             "fcrypt from PyPI.", newline=True)
./trac/util/compat.py:        from fcrypt import crypt
./trac/wiki/default-pages/TracStandalone:  Note: It is necessary (at least with Python 2.6) to install the fcrypt package in order to

It appears the fcrypt library is unmaintained, and it can no longer be installed from PyPI:

$pip install fcrypt
You are using pip version 6.0.8, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting fcrypt
  Could not find any downloads that satisfy the requirement fcrypt
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external fcrypt to allow).
  No distributions at all found for fcrypt

I'd like to consider whether we should replace fcrypt with passlib. This was suggested in gmessage:trac-users:VhovR3jNRMg/XyLm7PDFBgAJ.

Attachments (0)

Change History (5)

comment:1 by Ryan J Ollos, 9 years ago

passlib.hashlib.des_crypt appears to give the same results as crypt.

On Unix (Mac OSX):

>>> from passlib.hash import des_crypt
>>> des_crypt.encrypt('abcdefghijklmnopqrstuvwxyz', salt='01')
'01Hifx8xXNsuc'
>>> from crypt import crypt
>>> crypt('abcdefghijklmnopqrstuvwxyz', '01')
'01Hifx8xXNsuc'

On Windows:

>>> from passlib.hash import des_crypt
>>> from fcrypt import crypt
>>> crypt('abcdefghijklmnopqrstuvwxyz', '01')
'01Hifx8xXNsuc'
>>> des_crypt.encrypt('abcdefghijklmnopqrstuvwxyz', salt='01')
'01Hifx8xXNsuc'

The main advantage I see to replacing fcrypt with passlib is that the latter is maintained, and available on PyPI. Also, AccountManagerPlugin is using passlib and the library may be useful as we add more AccountManager features to Trac.

comment:2 by Ryan J Ollos, 9 years ago

Milestone: next-major-releases1.2
Owner: set to Ryan J Ollos
Release Notes: modified (diff)
Status: newassigned

Proposed changes in log:rjollos.git:t12239_passlib. Tests passing on Windows 7 with Python 2.7.11.

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:3 by Ryan J Ollos, 9 years ago

DONE Update AppVeyor build configuration (1.2dev builds fine with passlib, e.g. 2.6, 2.7)

Last edited 9 years ago by Christian Boos (previous) (diff)

comment:4 by Ryan J Ollos, 9 years ago

Resolution: fixed
Status: assignedclosed

Committed to trunk in [14464].

comment:5 by Ryan J Ollos, 9 years ago

Additional documentation edits:

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.