From 5e7e7a933fea146b8dd41462586d8fded340d397 Mon Sep 17 00:00:00 2001 From: Florian Eitel Date: Tue, 7 Mar 2023 17:47:59 +0100 Subject: [PATCH] Update update_secret database field length for salted hash --- .../migrations/0013_alter_host_update_secret.py | 17 +++++++++++++++++ src/nsupdate/main/models.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/nsupdate/main/migrations/0013_alter_host_update_secret.py diff --git a/src/nsupdate/main/migrations/0013_alter_host_update_secret.py b/src/nsupdate/main/migrations/0013_alter_host_update_secret.py new file mode 100644 index 0000000..72292da --- /dev/null +++ b/src/nsupdate/main/migrations/0013_alter_host_update_secret.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.5 on 2023-03-07 16:47 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("main", "0012_auto_20191230_1729"), + ] + + operations = [ + migrations.AlterField( + model_name="host", + name="update_secret", + field=models.CharField(max_length=128, verbose_name="update secret"), + ), + ] diff --git a/src/nsupdate/main/models.py b/src/nsupdate/main/models.py index 1492e59..e418091 100644 --- a/src/nsupdate/main/models.py +++ b/src/nsupdate/main/models.py @@ -165,7 +165,7 @@ class Host(models.Model): domain = models.ForeignKey(Domain, on_delete=models.CASCADE, verbose_name=_("domain")) update_secret = models.CharField( _("update secret"), - max_length=64, # secret gets hashed (on save) to salted sha1, 58 bytes str len + max_length=128, # secret gets hashed (on save) to salted sha1, "sha1" + "$" + 22 chars salt + "$" + 40 chars sha1 = 68 chars ) comment = models.CharField( _("comment"),