| 1 |
# SPDX-License-Identifier: MPL-2.0 |
| 2 |
|
| 3 |
from test.common.classes import TestClasses |
| 4 |
|
| 5 |
from cryptodatahub.ssh.algorithm import ( |
| 6 |
SshEllipticCurveIdentifier, |
| 7 |
SshEncryptionAlgorithm, |
| 8 |
SshMacAlgorithm, |
| 9 |
SshKexAlgorithm, |
| 10 |
SshHostKeyAlgorithm, |
| 11 |
SshCompressionAlgorithm, |
| 12 |
) |
| 13 |
|
| 14 |
|
| 15 |
class TestSshEncryptionAlgorithm(TestClasses.TestJsonCodeStringBase): |
| 16 |
@classmethod |
| 17 |
def _get_class(cls): |
| 18 |
return SshEncryptionAlgorithm |
| 19 |
|
| 20 |
|
| 21 |
class TestSshMacAlgorithm(TestClasses.TestJsonCodeStringBase): |
| 22 |
@classmethod |
| 23 |
def _get_class(cls): |
| 24 |
return SshMacAlgorithm |
| 25 |
|
| 26 |
def test_size(self): |
| 27 |
self.assertEqual(SshMacAlgorithm.HMAC_SHA2_256.value.size, 256) |
| 28 |
self.assertEqual(SshMacAlgorithm.HMAC_SHA2_256_96.value.size, 96) |
| 29 |
|
| 30 |
|
| 31 |
class TestSshKexAlgorithm(TestClasses.TestJsonCodeStringBase): |
| 32 |
@classmethod |
| 33 |
def _get_class(cls): |
| 34 |
return SshKexAlgorithm |
| 35 |
|
| 36 |
|
| 37 |
class TestSshHostKeyAlgorithm(TestClasses.TestJsonCodeStringBase): |
| 38 |
@classmethod |
| 39 |
def _get_class(cls): |
| 40 |
return SshHostKeyAlgorithm |
| 41 |
|
| 42 |
|
| 43 |
class TestSshCompressionAlgorithm(TestClasses.TestJsonCodeStringBase): |
| 44 |
@classmethod |
| 45 |
def _get_class(cls): |
| 46 |
return SshCompressionAlgorithm |
| 47 |
|
| 48 |
|
| 49 |
class TestSshEllipticCurveIdentifier(TestClasses.TestJsonCodeStringBase): |
| 50 |
@classmethod |
| 51 |
def _get_class(cls): |
| 52 |
return SshEllipticCurveIdentifier |