pol icon indicating copy to clipboard operation
pol copied to clipboard

Installation issues in Fedora

Open Treora opened this issue 5 years ago • 2 comments

Documenting a couple of problems I ran into while trying to install pol on Fedora 30 (in a VM in Qubes OS).

Looking at the Ubuntu-based instructions, I installed what appeared to be the equivalent dependencies in Fedora (I hope?), and some others that popped up in "missing header file" compilation errors.

[user@disp9649 ~]$ sudo dfn install @development-tools gmp-devel mpfr-devel libmpc-devel python-devel python-pip
[user@disp9649 ~]$ pip2.7 install --user pol

This seemed to work fine; except of course the deprecation notice about Python 2.7. (any intention on porting pol to Python 3? Or might pol itself be considered deprecated? [edit] I see there's a WIP PR for that!)

Running pol init gives an error:

[user@disp9649 ~]$ pol init
You are about to create a new safe.  A safe can have up to six
separate containers to store your secrets.  A container is
accessed by one of its passwords.  Without one of its passwords,
you cannot prove the existence of a container.

Container #1
  Each container must have a master-password.  This password gives
  full access to the container.

    Enter master-password:
An unhandled exception occured:

   Traceback (most recent call last):
     File "/home/user/.local/lib/python2.7/site-packages/pol/main.py", line 1318, in _run_command
       return self.args.func()
     File "/home/user/.local/lib/python2.7/site-packages/pol/main.py", line 599, in cmd_init
       'Enter master-password: ', '    ', False)
     File "/home/user/.local/lib/python2.7/site-packages/pol/terminal.py", line 87, in zxcvbn_getpass
       strength = zxcvbn.password_strength(current)
     File "/home/user/.local/lib/python2.7/site-packages/demandimport/__init__.py", line 117, in __getattribute__
       return getattr(self._module, attr)
   AttributeError: 'module' object has no attribute 'password_strength'
  
Please report this error:

   https://github.com/bwesterb/pol/issues

(error occurs after typing the first character for the master password)

Anyhow, I have an existing ~/.pol file, in my 'vault' VM. I copied .local/bin/pol and .local/lib/python2.7 into the vault VM and continued there:

[user@vault ~]$ pol get test
WARNING:pol.elgamal:pycrypto not built with _fastmath module.  A lot will be quite slow
Enter password:

An unhandled exception occured:

   Traceback (most recent call last):
     File "/home/user/.local/lib/python2.7/site-packages/pol/main.py", line 1318, in _run_command
       return self.args.func()
     File "/home/user/.local/lib/python2.7/site-packages/pol/main.py", line 702, in cmd_get
       else getpass.getpass('Enter password: ')):
     File "/home/user/.local/lib/python2.7/site-packages/pol/safe.py", line 748, in open_containers
       password, additional_keys))
     File "/home/user/.local/lib/python2.7/site-packages/pol/ks.py", line 49, in __call__
       return self.stretch(password)
     File "/home/user/.local/lib/python2.7/site-packages/pol/ks.py", line 76, in stretch
       return scrypt.hash(password,
     File "/home/user/.local/lib/python2.7/site-packages/demandimport/__init__.py", line 116, in __getattribute__
       self._load()
     File "/home/user/.local/lib/python2.7/site-packages/demandimport/__init__.py", line 79, in _load
       mod = _origimport(path, globals, locals, fromlist)
   ImportError: No module named scrypt
  
Please report this error:

   https://github.com/bwesterb/pol/issues

So I ran (again in the disposable VM)

[user@disp9649 ~]$ pip2.7 install --user scrypt

..and copied the scrypt folders/files in site-packages to the vault VM to try again:

[user@vault ~]$ pol get test
WARNING:pol.elgamal:pycrypto not built with _fastmath module.  A lot will be quite slow
Enter password:

An unhandled exception occured:

   Traceback (most recent call last):
     File "/home/user/.local/lib/python2.7/site-packages/pol/main.py", line 1318, in _run_command
       return self.args.func()
     File "/home/user/.local/lib/python2.7/site-packages/pol/main.py", line 702, in cmd_get
       else getpass.getpass('Enter password: ')):
     File "/home/user/.local/lib/python2.7/site-packages/pol/safe.py", line 750, in open_containers
       for sl in self._find_slices(access_key):
     File "/home/user/.local/lib/python2.7/site-packages/pol/safe.py", line 1021, in _find_slices
       yield self._load_slice_from_first_block(key, index, pt)
     File "/home/user/.local/lib/python2.7/site-packages/pol/safe.py", line 1041, in _load_slice_from_first_block
       cipherstream = self._cipherstream(key, iv)
     File "/home/user/.local/lib/python2.7/site-packages/pol/safe.py", line 1095, in _cipherstream
       return self.cipher.new_stream(self._cipherstream_key(key), iv)
     File "/home/user/.local/lib/python2.7/site-packages/pol/blockcipher.py", line 80, in new_stream
       cipher = Crypto.Cipher.AES.new(key, Crypto.Cipher.AES.MODE_CTR,
     File "/home/user/.local/lib/python2.7/site-packages/demandimport/__init__.py", line 116, in __getattribute__
       self._load()
     File "/home/user/.local/lib/python2.7/site-packages/demandimport/__init__.py", line 79, in _load
       mod = _origimport(path, globals, locals, fromlist)
     File "/home/user/.local/lib/python2.7/site-packages/Crypto/Cipher/__init__.py", line 27, in <module>
       from Crypto.Cipher._mode_ecb import _create_ecb_cipher
     File "/home/user/.local/lib/python2.7/site-packages/demandimport/__init__.py", line 166, in _demandimport
       mod = _origimport(name, globals, locals)
     File "/home/user/.local/lib/python2.7/site-packages/Crypto/Cipher/_mode_ecb.py", line 29, in <module>
       from Crypto.Util._raw_api import (load_pycryptodome_raw_lib,
     File "/home/user/.local/lib/python2.7/site-packages/demandimport/__init__.py", line 166, in _demandimport
       mod = _origimport(name, globals, locals)
     File "/home/user/.local/lib/python2.7/site-packages/Crypto/Util/_raw_api.py", line 88, in <module>
       uint8_t_type = ffi.typeof(ffi.new("const uint8_t*"))
     File "/home/user/.local/lib/python2.7/site-packages/cffi/api.py", line 266, in new
       cdecl = self._typeof(cdecl)
     File "/home/user/.local/lib/python2.7/site-packages/cffi/api.py", line 186, in _typeof
       result = self._typeof_locked(cdecl)
     File "/home/user/.local/lib/python2.7/site-packages/cffi/api.py", line 171, in _typeof_locked
       type = self._parser.parse_type(cdecl)
     File "/home/user/.local/lib/python2.7/site-packages/cffi/cparser.py", line 520, in parse_type
       return self.parse_type_and_quals(cdecl)[0]
     File "/home/user/.local/lib/python2.7/site-packages/cffi/cparser.py", line 523, in parse_type_and_quals
       ast, macros = self._parse('void __dummy(\n%s\n);' % cdecl)[:2]
     File "/home/user/.local/lib/python2.7/site-packages/cffi/cparser.py", line 305, in _parse
       ast = _get_parser().parse(fullcsource)
     File "/home/user/.local/lib/python2.7/site-packages/cffi/cparser.py", line 52, in _get_parser
       _parser_cache = pycparser.CParser()
     File "/home/user/.local/lib/python2.7/site-packages/pycparser/c_parser.py", line 88, in __init__
       outputdir=taboutputdir)
     File "/home/user/.local/lib/python2.7/site-packages/pycparser/c_lexer.py", line 66, in build
       self.lexer = lex.lex(object=self, **kwargs)
     File "/home/user/.local/lib/python2.7/site-packages/pycparser/ply/lex.py", line 914, in lex
       lexobj.readtab(lextab, ldict)
     File "/home/user/.local/lib/python2.7/site-packages/pycparser/ply/lex.py", line 216, in readtab
       lextab = sys.modules[tabfile]
   KeyError: 'pycparser.lextab'
  
Please report this error:

   https://github.com/bwesterb/pol/issues

This is not obviously a missing dependency, so I did not investigate further. The error occurs regardless of whether the requested entry exists in the ~/.pol file.

I will try another password manager now, but while it worked I was quite happy with pol! :)

Treora avatar Jun 29 '20 15:06 Treora

It's time to bite the bullet: I've merged the Python 3 rewrite of Pol. You you try again?

bwesterb avatar Jul 05 '20 17:07 bwesterb

(And please, make a backup of .pol.)

bwesterb avatar Jul 05 '20 17:07 bwesterb