You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by GitBox <gi...@apache.org> on 2019/03/19 19:06:06 UTC

[GitHub] [libcloud] Kami commented on a change in pull request #1280: Replace all usage of PyCrypto with python-cryptography

Kami commented on a change in pull request #1280: Replace all usage of PyCrypto with python-cryptography
URL: https://github.com/apache/libcloud/pull/1280#discussion_r267052975
 
 

 ##########
 File path: libcloud/test/test_utils.py
 ##########
 @@ -385,6 +389,26 @@ def test_increment_ipv4_segments(self):
             self.assertEqual(result, incremented_ip)
 
 
+class TestPublicKeyUtils(unittest.TestCase):
+
+    PUBKEY = (
+        'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOfbWSXOlqvYjZmRO84/lIoV4gvuX+'
+        'P1lLg50MMg6jZjLZIlYY081XPRmuom0xY0+BO++J2KgLl7gxJ6xMsKK2VQ+TakdfAH20'
+        'XfMcTohd/zVCeWsbqZQvEhVXBo4hPIktcfNz0u9Ez3EtInO+kb7raLcRhOVi9QmOkOrC'
+        'WtQU9mS71AWJuqI9H0YAnTiI8Hs5bn2tpMIqmTXT3g2bwywC25x1Nx9Hy0/FP+KUL6Ag'
+        'vDXv47l+TgSDfTBEkvq+IF1ITrnaOG+nRE02oZC6cwHYTifM/IOollkujxIQmi2Z+j66'
+        'OHSrjnEQugr0FqGJF2ygKfIh/i2u3fVLM60qE2NN user@example'
+    )
+
+    def test_pubkey_openssh_fingerprint(self):
+        fp = get_pubkey_openssh_fingerprint(self.PUBKEY)
+        assert fp == '35:22:13:5b:82:e2:5d:e1:90:8c:73:74:9f:ef:3b:d8'
+
+    def test_pubkey_ssh2_fingerprint(self):
+        fp = get_pubkey_ssh2_fingerprint(self.PUBKEY)
+        assert fp == '11:ad:5d:4c:5b:99:c9:80:7e:81:03:76:5a:25:9d:8c'
 
 Review comment:
   Yeah, I think it's related to an edge case in ``hexadigits`` utility function - I'm looking into it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services