1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #2473: Fix encoding of long (>127 character) secrets

This commit is contained in:
Jeremy Stretch
2018-11-07 13:44:16 -05:00
parent c1838104ae
commit 69d829ce8d
3 changed files with 20 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
from __future__ import unicode_literals
import string
from Crypto.PublicKey import RSA
from django.conf import settings
@@ -88,7 +89,7 @@ class SecretTestCase(TestCase):
"""
Test basic encryption and decryption functionality using a random master key.
"""
plaintext = "FooBar123"
plaintext = string.printable * 2
secret_key = generate_random_key()
s = Secret(plaintext=plaintext)
s.encrypt(secret_key)