Bug 1175076
| Summary: | virt-who crashes when ecryption key doesn't exist | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Liushihui <shihliu> | |
| Component: | virt-who | Assignee: | Radek Novacek <rnovacek> | |
| Status: | CLOSED ERRATA | QA Contact: | Li Bin Liu <liliu> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | high | |||
| Version: | 7.1 | CC: | gxing, ovasik, sgao | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | x86_64 | |||
| OS: | All | |||
| Whiteboard: | ||||
| Fixed In Version: | virt-who-0.14-1.el7 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1208029 1221027 (view as bug list) | Environment: | ||
| Last Closed: | 2015-11-19 11:55:51 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1205796, 1208029, 1221027 | |||
|
Description
Liushihui
2014-12-17 05:56:40 UTC
Do I understand it correctly that you've encrypted the password on different machine than it's used on? There is no solution for this issue, the encrypted password is bound to the key it was created with. You'll have to copy the key to the target machine. On the other hand, virt-who should only print an error but shouldn't crash. Let's use this bug to track fixing it. Configure len(encrypted_password)!=32bit(encrypted_password=111111) , it also has the same problem. please see the virt-who's log as the following:
2014-12-26 15:46:55,495 [ERROR] @virtwho.py:480 - Fatal error:
Traceback (most recent call last):
File "/usr/share/virt-who/virtwho.py", line 475, in <module>
main()
File "/usr/share/virt-who/virtwho.py", line 434, in main
_main(logger, options)
File "/usr/share/virt-who/virtwho.py", line 445, in _main
virtWho = VirtWho(logger, options)
File "/usr/share/virt-who/virtwho.py", line 81, in __init__
self.configManager = ConfigManager()
File "/usr/share/virt-who/config.py", line 147, in __init__
self._readConfig()
File "/usr/share/virt-who/config.py", line 153, in _readConfig
config = Config.fromParser(section, self._parser)
File "/usr/share/virt-who/config.py", line 87, in fromParser
password = Password.decrypt(unhexlify(crypted))
File "/usr/share/virt-who/password/__init__.py", line 73, in decrypt
return cls._unpad(cls._crypt(cls.DECRYPT, key, iv, enc))
File "/usr/share/virt-who/password/__init__.py", line 62, in _crypt
outf.write(cipher.final())
File "/usr/lib64/python2.7/site-packages/M2Crypto/EVP.py", line 128, in final
return m2.cipher_final(self.ctx)
EVPError: data not multiple of block length
2014-12-26 15:46:55,495 [ERROR] @virtwho.py:480 - Fatal error:
Traceback (most recent call last):
File "/usr/share/virt-who/virtwho.py", line 475, in <module>
main()
File "/usr/share/virt-who/virtwho.py", line 434, in main
_main(logger, options)
File "/usr/share/virt-who/virtwho.py", line 445, in _main
virtWho = VirtWho(logger, options)
File "/usr/share/virt-who/virtwho.py", line 81, in __init__
self.configManager = ConfigManager()
File "/usr/share/virt-who/config.py", line 147, in __init__
self._readConfig()
File "/usr/share/virt-who/config.py", line 153, in _readConfig
config = Config.fromParser(section, self._parser)
File "/usr/share/virt-who/config.py", line 87, in fromParser
password = Password.decrypt(unhexlify(crypted))
File "/usr/share/virt-who/password/__init__.py", line 73, in decrypt
return cls._unpad(cls._crypt(cls.DECRYPT, key, iv, enc))
File "/usr/share/virt-who/password/__init__.py", line 62, in _crypt
outf.write(cipher.final())
File "/usr/lib64/python2.7/site-packages/M2Crypto/EVP.py", line 128, in final
return m2.cipher_final(self.ctx)
EVPError: data not multiple of block length
[Note]: If the len(encrypted_password)=32bit, it won't occur this problem.virt-who can run normally but show some error log
This bug is resolved upstream and will be fixed by virt-who rebase (bug 1200374). Fixed in virt-who-0.14-1.el7. verified it on virt-who-0.14-1.el7.noarch. Verified version: virt-who-0.14-1.el7.noarch subscription-manager-1.15.5-1.el7.x86_64 python-rhsm-1.15.3-1.el7.x86_64 Verified process: 1.When encrypted and decrypted password doesn't exist, failed to start virt-who service and it will show error log in /var/log/rhsm/rhsm.log as the following: [root@hp-z220-05 ~]# systemctl retart virt-who 2015-07-15 15:46:56,952 [ERROR] @virtwho.py:550 - [Errno 2] No such file or directory: '/var/lib/virt-who/key' 2. When password or key is broken (wrong length), still failed to start virt-who service and it will show error log in /var/log/rhsm/rhsm.log as the folllowing: 2015-07-15 16:38:18,128 [ERROR] @virtwho.py:550 - Password can't be decrypted, possibly corrupted Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2370.html |