Bug 611405 - RandomPool_DeprecationWarning in fc13
Summary: RandomPool_DeprecationWarning in fc13
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-paramiko
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jeffrey C. Ollie
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-05 06:46 UTC by Eddie Lania
Modified: 2011-01-13 23:38 UTC (History)
7 users (show)

Fixed In Version: python-paramiko-1.7.6-3.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-13 23:35:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 271791 0 None None None Never

Description Eddie Lania 2010-07-05 06:46:10 UTC
Description of problem: When fwbackups is used:

/usr/lib/python2.6/site-packages/Crypto/Util/randpool.py:40: RandomPool_DeprecationWarning: This application uses RandomPool, which is BROKEN in older releases.  See http://www.pycrypto.org/randpool-broken
  RandomPool_DeprecationWarning)




Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1.Use fwbackups
2.
3.
  
Actual results: Message: /usr/lib/python2.6/site-packages/Crypto/Util/randpool.py:40: RandomPool_DeprecationWarning: This application uses RandomPool, which is BROKEN in older releases.  See http://www.pycrypto.org/randpool-broken
  RandomPool_DeprecationWarning)



Expected results: No such message


Additional info:

Comment 1 Stewart Adam 2010-07-05 07:10:51 UTC
Reassigning to python-crypto - fwbackups imports paramiko (which fwbackups requires for SFTP access) and paramiko requires python-crypto.

I co-maintain python-crypto so I'll be able to take a look at this soon.

Comment 2 Paul Howarth 2010-07-05 08:08:18 UTC
http://lists.dlitz.net/pipermail/pycrypto/2008q3/000020.html looks relevant. I think this should be fixed in paramiko rather than patching out the deprecation warning in python-crypto.

Comment 3 Stewart Adam 2010-07-05 19:18:16 UTC
(In reply to comment #2)
> http://lists.dlitz.net/pipermail/pycrypto/2008q3/000020.html looks relevant. I
> think this should be fixed in paramiko rather than patching out the deprecation
> warning in python-crypto.    
Agreed... For some reason I was thinking that pycrypto was using RandomPool, but that doesn't make any sense. The problem definitely needs to be resolved in paramiko.

It seems that paramiko does use RandomPool, but fixes the problem on its own. This is the description of StrongLockingRandomPool in paramiko/rng.py:
    """Wrapper around RandomPool guaranteeing strong random numbers.

    Crypto.Util.randpool.RandomPool will silently operate even if it is seeded
    with little or no entropy, and it provides no prediction resistance if its
    state is ever compromised throughout its runtime.  It is also not thread-safe.

    This wrapper augments RandomPool by XORing its output with random bits from
    the operating system, and by controlling access to the underlying
    RandomPool using an exclusive lock.
    """
This file was written by the pycrypto maintainer himself: http://www.lag.net/pipermail/paramiko/2008-April/000678.html

Until Paramiko adopts the new API, one possible solution would be to simply suppress the warning as done in the bzr-installers-mac: https://bugs.launchpad.net/bzr-mac-installers/+bug/507762/comments/9

Comment 4 Paul Howarth 2010-07-05 20:41:27 UTC
Is the patch attached to http://www.lag.net/pipermail/paramiko/2008-April/000679.html not suitable for use right now?

Comment 5 Stewart Adam 2010-07-06 07:38:26 UTC
(In reply to comment #4)
> Is the patch attached to
> http://www.lag.net/pipermail/paramiko/2008-April/000679.html not suitable for
> use right now?    
That patch has already been applied, the problem is that this the security hazard of using RandomPool was negated by reading data from the OS-specific RNG (ie /dev/urandom) and using that to XORing the RandomPool output. The import is still there so Python issues the warning, but the security risk is no longer there for paramiko (for other apps, it's a different story).

Comment 6 Eddie Lania 2011-01-04 08:08:05 UTC
I don't know what has changed in the meanwhile but last backup that ran produced the following output:

/usr/lib/python2.6/site-packages/Crypto/Util/randpool.py:40: RandomPool_DeprecationWarning: This application uses RandomPool, which is BROKEN in older releases.  See http://www.pycrypto.org/randpool-broken
  RandomPool_DeprecationWarning)
Traceback (most recent call last):
  File "/usr/bin/fwbackups-run", line 97, in <module>
    prefs = config.PrefsConf(create=True)
  File "/usr/lib/python2.6/site-packages/fwbackups/config.py", line 677, in __init__
    self.__import()
  File "/usr/lib/python2.6/site-packages/fwbackups/config.py", line 817, in __import
    cron.write(crontabLines)
  File "/usr/lib/python2.6/site-packages/fwbackups/cron.py", line 224, in write
    raise CronError(_('Could not write new crontab:\n%(a)s%(b)s') % {'a': stdout, 'b': stderr})
fwbackups.cron.CronError: 'Could not write new crontab:\nno crontab for root - using an empty one\n python: can\'t open file \'/usr/bin/cronwriter.py\': [Errno 2] No such file or directory\n crontab: "python /usr/bin/cronwriter.py" exited with status 2\n'

I am not very glad with this.

Things seem to get worse instead of better.

Comment 7 Toshio Ernie Kuratomi 2011-01-04 16:12:01 UTC
That's a bug in fwbackups rather than paramiko.  Looks like it's been fixed as well:

https://bugzilla.redhat.com/show_bug.cgi?id=664077

Comment 8 Toshio Ernie Kuratomi 2011-01-04 16:42:37 UTC
Paramiko documents launchpad as the place for bugs and github as the place for code.  However, this issue is opened on both without Robey Pointer (upstream maintainer) having responded:

https://bugs.launchpad.net/paramiko/+bug/271791
https://github.com/robey/paramiko/issues#issue/1

There's a patch/pull request to solve this that was created in September:
  http://github.com/garyvdm/paramiko
  https://github.com/robey/paramiko/pull/8

We probably want to pull this for our package and probably should start talking to the other distributions about coming up with a team of people to take over maintainance (Robey Pointer said he was moving to github because he didn't use paramiko (at least the python version) anymore and wanted other people to be able to take over).

Comment 9 Fedora Update System 2011-01-04 23:32:55 UTC
python-paramiko-1.7.6-3.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/python-paramiko-1.7.6-3.fc14

Comment 10 Fedora Update System 2011-01-04 23:33:02 UTC
python-paramiko-1.7.6-3.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/python-paramiko-1.7.6-3.fc13

Comment 11 Toshio Ernie Kuratomi 2011-01-05 00:48:50 UTC
Eddie, if you could test that update and verify that it gets rid of the deprecation warning I'd be much appreciative.  Bodhi should let us know when it is pushed to the testing repo or you could download it directly from koji (by following the links on the update page).

Comment 12 Eddie Lania 2011-01-05 16:35:32 UTC
I have tested it running:

[root@ls2ka ~]# fwbackups-run Maandelijks
Jan 05 17:25:22 :: INFO : Starting automatic backup operation of set `Maandelijks'
Jan 05 17:25:25 :: INFO : Using tar.gz: Must backup all paths at once - Progress notification will be disabled.
Jan 05 17:30:08 :: INFO : Finished automatic backup operation of set 'Maandelijks'


I did not see any errors.
Looks like it is solved and the update can be forwarded to stable.

Thank you very much.


Regards, Eddie.

Comment 13 Fedora Update System 2011-01-05 21:19:26 UTC
python-paramiko-1.7.6-3.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update python-paramiko'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/python-paramiko-1.7.6-3.fc14

Comment 14 Fedora Update System 2011-01-13 23:35:20 UTC
python-paramiko-1.7.6-3.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2011-01-13 23:38:49 UTC
python-paramiko-1.7.6-3.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


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