Skip to content

Commit

Permalink
Version 0.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenning committed Feb 22, 2024
1 parent f6288a0 commit 972fa7e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
- Summary:
- Insert something here

## Version: 0.6.7

- Released: 2024-02-22
- Summary:
- Fix missing `self`
- Add test for hashing cisco type 5 and cisco type 8 passwords

## Version: 0.6.6

- Released: 2024-02-22
Expand Down
2 changes: 1 addition & 1 deletion ciscoconfparse2/ciscoconfparse2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3888,7 +3888,7 @@ def decrypt_type_8(self, pwd):
raise NotImplementedError()

@logger.catch(reraise=True)
def encrypt_type_8(pwd):
def encrypt_type_8(self, pwd):
"""
Hashes cleartext password to Cisco type 8
:param pwd: Clear text password to be hashed
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ requires-python = ">=3.8"

[tool.poetry]
name = "ciscoconfparse2"
version = "0.6.6"
version = "0.6.7"
description = "Parse, Audit, Query, Build, and Modify Cisco IOS-style and JunOS-style configs"
license = "GPL-3.0-only"
authors = [
Expand Down
12 changes: 6 additions & 6 deletions sphinx-doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ Installation
pip
---

``pip install -U ciscoconfparse2 >= 0.6.6``
``pip install -U ciscoconfparse2 >= 0.6.7``

requirements.txt: pypi
----------------------

If you need a direct ``pypi`` dependency entry in your ``requirements.txt``
file, you can include an entry like this.

``ciscoconfparse2 == 0.6.6``
``ciscoconfparse2 == 0.6.7``

``0.6.6`` is used only as a reference; choose the correct release for your
``0.6.7`` is used only as a reference; choose the correct release for your
project.

requirements.txt: github
------------------------

If you need a direct ``git`` dependency entry in your ``requirements.txt``
file, you can include an entry like this (where ``0.6.6`` is a specific
file, you can include an entry like this (where ``0.6.7`` is a specific
``git tag`` that you want to reference.

``git+https://github.com/mpenning/[email protected].6``
``git+https://github.com/mpenning/[email protected].7``

``0.6.6`` is used only as a reference; choose the correct release for your
``0.6.7`` is used only as a reference; choose the correct release for your
project.
23 changes: 22 additions & 1 deletion tests/test_CiscoConfParse.py
Original file line number Diff line number Diff line change
Expand Up @@ -3132,7 +3132,28 @@ def testValues_CiscoPassword_decrypt_7_01():
assert correct_result == test_result_01
assert correct_result == test_result_02

def testValues_CiscoPassword_decrypt_9_01():
def testValues_CiscoPassword_encrypt_5_01():
"""Test that we can build a type 5 password hash"""
test_result_01 = CiscoPassword().encrypt_type_5("cisco")

one_correct_result = "$1$pFgG$bUkwuomK10T9JcYmDCOJv1"
assert len(one_correct_result) == len(test_result_01)
# We can only compare the first three characters...
# the rest are basically random
assert one_correct_result[0:3] == test_result_01[0:3]

def testValues_CiscoPassword_encrypt_8_01():
"""Test that we can build a type 8 password hash"""
test_result_01 = CiscoPassword().encrypt_type_8("cisco")

one_correct_result = "$8$5VnMVRhw7Wf./D$Bpkgb2i4FgTxRwjCKafdtvO7rw2cVLSM2NlhrpdDUCo"
assert len(one_correct_result) == len(test_result_01)
# We can only compare the first three characters...
# the rest are basically random
assert one_correct_result[0:3] == test_result_01[0:3]

def testValues_CiscoPassword_encrypt_9_01():
"""Test that we can build a type 9 password hash"""
test_result_01 = CiscoPassword().encrypt_type_9("cisco")

one_correct_result = "$9$5etsgfGnB46s.8$5.haZUvlChIWsYPyAT8E7hxUZX8LNWireAy40LsdxVA"
Expand Down

0 comments on commit 972fa7e

Please sign in to comment.