Esempio n. 1
0
def test_ciscohashpix_user():
    assert passlib.hash.cisco_pix.verify(
        PASSWORD,
        filterciscohash.FilterModule().ciscohashpix(PASSWORD, USER),
        user=USER)
Esempio n. 2
0
def test_ciscohashasa():
    assert passlib.hash.cisco_asa.verify(
        PASSWORD,
        filterciscohash.FilterModule().ciscohashasa(PASSWORD))
Esempio n. 3
0
def test_ciscohash5():
    assert passlib.hash.md5_crypt.verify(
        PASSWORD,
        filterciscohash.FilterModule().ciscohash5(PASSWORD))
Esempio n. 4
0
def test_ciscohash7():
    assert passlib.hash.cisco_type7.decode(
        filterciscohash.FilterModule().ciscohash7(PASSWORD)) == PASSWORD
Esempio n. 5
0
import filterciscohash

TEMPLATES = {
    'ciscohash5_template': '{{password|ciscohash5}}',
    'ciscohash7_template': '{{password|ciscohash7}}',
    'ciscohashasa_template': '{{password|ciscohashasa}}',
    'ciscohashasa_user_template': '{{password|ciscohashasa(user)}}',
    'ciscohashpix_template': '{{password|ciscohashpix}}',
    'ciscohashpix_user_template': '{{password|ciscohashpix(user)}}'
}

PASSWORD = '******'
USER = '******'

environment = Environment(loader=DictLoader(TEMPLATES))
environment.filters['ciscohash5'] = filterciscohash.FilterModule().ciscohash5
environment.filters['ciscohash7'] = filterciscohash.FilterModule().ciscohash7
environment.filters['ciscohashasa'] = filterciscohash.FilterModule(
).ciscohashasa
environment.filters['ciscohashpix'] = filterciscohash.FilterModule(
).ciscohashpix

PASSWORD = '******'


def test_ciscohash5():
    assert passlib.hash.md5_crypt.verify(
        PASSWORD,
        filterciscohash.FilterModule().ciscohash5(PASSWORD))