diff options
| -rw-r--r-- | CHANGELOG.md | 9 | ||||
| -rw-r--r-- | COPYING | 2 | ||||
| -rw-r--r-- | LICENSE | 2 | ||||
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | sphinx_conf.py | 6 | ||||
| -rw-r--r-- | src/otp2289/__init__.py | 4 | ||||
| -rw-r--r-- | src/otp2289/__main__.py | 2 | ||||
| -rw-r--r-- | src/otp2289/generator.py | 2 | ||||
| -rw-r--r-- | src/otp2289/server.py | 9 | ||||
| -rw-r--r-- | tests/test_generator.py | 2 | ||||
| -rw-r--r-- | tests/test_main.py | 2 | ||||
| -rw-r--r-- | tests/test_server.py | 4 | ||||
| -rw-r--r-- | tests/test_static.py | 2 |
13 files changed, 35 insertions, 17 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 17b7d91..6cffe69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
| @@ -1,5 +1,14 @@ | |||
| 1 | # Changelog | 1 | # Changelog |
| 2 | 2 | ||
| 3 | ## [1.2.0](https://github.com/blackm0re/pyotp2289/tree/1.2.0) (2023-01-05) | ||
| 4 | |||
| 5 | [Full Changelog](https://github.com/blackm0re/pyotp2289/compare/1.1.1...1.2.0) | ||
| 6 | |||
| 7 | **Changes:** | ||
| 8 | |||
| 9 | - Add the `OTPState.ot_hex` property | ||
| 10 | |||
| 11 | |||
| 3 | ## [1.1.1](https://github.com/blackm0re/pyotp2289/tree/1.1.1) (2022-04-02) | 12 | ## [1.1.1](https://github.com/blackm0re/pyotp2289/tree/1.1.1) (2022-04-02) |
| 4 | 13 | ||
| 5 | [Full Changelog](https://github.com/blackm0re/pyotp2289/compare/1.1.0...1.1.1) | 14 | [Full Changelog](https://github.com/blackm0re/pyotp2289/compare/1.1.0...1.1.1) |
| @@ -1,6 +1,6 @@ | |||
| 1 | SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 1 | SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 2 | 2 | ||
| 3 | Copyright (c) 2020-2022, Simeon Simeonov | 3 | Copyright (c) 2020-2023, Simeon Simeonov |
| 4 | All rights reserved. | 4 | All rights reserved. |
| 5 | 5 | ||
| 6 | Redistribution and use in source and binary forms, with or without | 6 | Redistribution and use in source and binary forms, with or without |
| @@ -1,6 +1,6 @@ | |||
| 1 | SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 1 | SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 2 | 2 | ||
| 3 | Copyright (c) 2020-2022, Simeon Simeonov | 3 | Copyright (c) 2020-2023, Simeon Simeonov |
| 4 | All rights reserved. | 4 | All rights reserved. |
| 5 | 5 | ||
| 6 | Redistribution and use in source and binary forms, with or without | 6 | Redistribution and use in source and binary forms, with or without |
| @@ -164,8 +164,8 @@ RFC-2289 consists of interactions between them. | |||
| 164 | # otp2289.server.OTPInvalidResponse exception is raised. | 164 | # otp2289.server.OTPInvalidResponse exception is raised. |
| 165 | 165 | ||
| 166 | # once the state has successfully validated the corresponding response, | 166 | # once the state has successfully validated the corresponding response, |
| 167 | the state **must never be used again** and a state corresponding to the | 167 | # the state **must never be used again** and a state corresponding to the |
| 168 | "next" (498) step created. | 168 | # "next" (498) step created. |
| 169 | state = state.get_next_state() | 169 | state = state.get_next_state() |
| 170 | 170 | ||
| 171 | # the next authentication attempt... | 171 | # the next authentication attempt... |
| @@ -209,7 +209,7 @@ Simeon Simeonov - sgs @ LiberaChat | |||
| 209 | 209 | ||
| 210 | ## [License](https://github.com/blackm0re/pyotp2289/blob/master/LICENSE) | 210 | ## [License](https://github.com/blackm0re/pyotp2289/blob/master/LICENSE) |
| 211 | 211 | ||
| 212 | Copyright (c) 2020-2022 Simeon Simeonov | 212 | Copyright (c) 2020-2023 Simeon Simeonov |
| 213 | All rights reserved. | 213 | All rights reserved. |
| 214 | 214 | ||
| 215 | [Licensed](https://github.com/blackm0re/pyotp2289/blob/master/LICENSE) under the BSD 2-clause. | 215 | [Licensed](https://github.com/blackm0re/pyotp2289/blob/master/LICENSE) under the BSD 2-clause. |
diff --git a/sphinx_conf.py b/sphinx_conf.py index 561db43..f9f0eca 100644 --- a/sphinx_conf.py +++ b/sphinx_conf.py | |||
| @@ -21,14 +21,14 @@ | |||
| 21 | # -- Project information ----------------------------------------------------- | 21 | # -- Project information ----------------------------------------------------- |
| 22 | 22 | ||
| 23 | project = 'pyotp2289' | 23 | project = 'pyotp2289' |
| 24 | copyright = '2020-2022, Simeon Simeonov' | 24 | copyright = '2020-2023, Simeon Simeonov' |
| 25 | author = 'Simeon Simeonov' | 25 | author = 'Simeon Simeonov' |
| 26 | 26 | ||
| 27 | # The short X.Y version | 27 | # The short X.Y version |
| 28 | version = '1.1.0' | 28 | version = '1.2.0' |
| 29 | 29 | ||
| 30 | # The full version, including alpha/beta/rc tags | 30 | # The full version, including alpha/beta/rc tags |
| 31 | release = '1.1.0' | 31 | release = '1.2.0' |
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | # -- General configuration --------------------------------------------------- | 34 | # -- General configuration --------------------------------------------------- |
diff --git a/src/otp2289/__init__.py b/src/otp2289/__init__.py index af8638c..4b600a0 100644 --- a/src/otp2289/__init__.py +++ b/src/otp2289/__init__.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2020-2022 Simeon Simeonov | 4 | # Copyright (c) 2020-2023 Simeon Simeonov |
| 5 | # All rights reserved. | 5 | # All rights reserved. |
| 6 | # | 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without | 7 | # Redistribution and use in source and binary forms, with or without |
| @@ -40,7 +40,7 @@ from .server import ( | |||
| 40 | ) | 40 | ) |
| 41 | 41 | ||
| 42 | __author__ = 'Simeon Simeonov' | 42 | __author__ = 'Simeon Simeonov' |
| 43 | __version__ = '1.1.1' | 43 | __version__ = '1.2.0' |
| 44 | __license__ = 'BSD 2-Clause' | 44 | __license__ = 'BSD 2-Clause' |
| 45 | 45 | ||
| 46 | 46 | ||
diff --git a/src/otp2289/__main__.py b/src/otp2289/__main__.py index 78e60e8..d267b1b 100644 --- a/src/otp2289/__main__.py +++ b/src/otp2289/__main__.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2020-2022 Simeon Simeonov | 4 | # Copyright (c) 2020-2023 Simeon Simeonov |
| 5 | # All rights reserved. | 5 | # All rights reserved. |
| 6 | # | 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without | 7 | # Redistribution and use in source and binary forms, with or without |
diff --git a/src/otp2289/generator.py b/src/otp2289/generator.py index 7b86e1b..73ca18b 100644 --- a/src/otp2289/generator.py +++ b/src/otp2289/generator.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2020-2022 Simeon Simeonov | 4 | # Copyright (c) 2020-2023 Simeon Simeonov |
| 5 | # All rights reserved. | 5 | # All rights reserved. |
| 6 | # | 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without | 7 | # Redistribution and use in source and binary forms, with or without |
diff --git a/src/otp2289/server.py b/src/otp2289/server.py index 066cba2..4305f75 100644 --- a/src/otp2289/server.py +++ b/src/otp2289/server.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2020-2022 Simeon Simeonov | 4 | # Copyright (c) 2020-2023 Simeon Simeonov |
| 5 | # All rights reserved. | 5 | # All rights reserved. |
| 6 | # | 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without | 7 | # Redistribution and use in source and binary forms, with or without |
| @@ -116,6 +116,13 @@ class OTPState: | |||
| 116 | return self._hash_algo | 116 | return self._hash_algo |
| 117 | 117 | ||
| 118 | @property | 118 | @property |
| 119 | def ot_hex(self) -> str: | ||
| 120 | """ot_hex-property""" | ||
| 121 | if self._current_digest is None: | ||
| 122 | return '' | ||
| 123 | return binascii.hexlify(self._current_digest).decode() | ||
| 124 | |||
| 125 | @property | ||
| 119 | def seed(self) -> str: | 126 | def seed(self) -> str: |
| 120 | """seed-property""" | 127 | """seed-property""" |
| 121 | return self._seed | 128 | return self._seed |
diff --git a/tests/test_generator.py b/tests/test_generator.py index aa795a3..b4bb961 100644 --- a/tests/test_generator.py +++ b/tests/test_generator.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2020-2022, Simeon Simeonov | 4 | # Copyright (c) 2020-2023, Simeon Simeonov |
| 5 | # All rights reserved. | 5 | # All rights reserved. |
| 6 | # | 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without | 7 | # Redistribution and use in source and binary forms, with or without |
diff --git a/tests/test_main.py b/tests/test_main.py index a331274..35bd2a2 100644 --- a/tests/test_main.py +++ b/tests/test_main.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2020-2022, Simeon Simeonov | 4 | # Copyright (c) 2020-2023, Simeon Simeonov |
| 5 | # All rights reserved. | 5 | # All rights reserved. |
| 6 | # | 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without | 7 | # Redistribution and use in source and binary forms, with or without |
diff --git a/tests/test_server.py b/tests/test_server.py index 3d3b77d..64e7f67 100644 --- a/tests/test_server.py +++ b/tests/test_server.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2020-2022, Simeon Simeonov | 4 | # Copyright (c) 2020-2023, Simeon Simeonov |
| 5 | # All rights reserved. | 5 | # All rights reserved. |
| 6 | # | 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without | 7 | # Redistribution and use in source and binary forms, with or without |
| @@ -80,6 +80,7 @@ def test_state_validation_md5(): | |||
| 80 | assert state.validated is False | 80 | assert state.validated is False |
| 81 | assert state.response_validates('0x9e876134d90499dd') is True | 81 | assert state.response_validates('0x9e876134d90499dd') is True |
| 82 | assert state.response_validates('INCH SEA ANNE LONG AHEM TOUR') is True | 82 | assert state.response_validates('INCH SEA ANNE LONG AHEM TOUR') is True |
| 83 | assert state.ot_hex == '7965e05436f5029f' | ||
| 83 | assert state.validated is True | 84 | assert state.validated is True |
| 84 | 85 | ||
| 85 | 86 | ||
| @@ -94,6 +95,7 @@ def test_state_validation_sha1(): | |||
| 94 | assert state.validated is False | 95 | assert state.validated is False |
| 95 | assert state.response_validates('0xbb9e6ae1979d8ff4') is True | 96 | assert state.response_validates('0xbb9e6ae1979d8ff4') is True |
| 96 | assert state.response_validates('MILT VARY MAST OK SEES WENT') is True | 97 | assert state.response_validates('MILT VARY MAST OK SEES WENT') is True |
| 98 | assert state.ot_hex == '63d936639734385b' | ||
| 97 | assert state.validated is True | 99 | assert state.validated is True |
| 98 | 100 | ||
| 99 | 101 | ||
diff --git a/tests/test_static.py b/tests/test_static.py index a942374..7635e5e 100644 --- a/tests/test_static.py +++ b/tests/test_static.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2020-2022, Simeon Simeonov | 4 | # Copyright (c) 2020-2023, Simeon Simeonov |
| 5 | # All rights reserved. | 5 | # All rights reserved. |
| 6 | # | 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without | 7 | # Redistribution and use in source and binary forms, with or without |
