aboutsummaryrefslogtreecommitdiff
path: root/perl/Wallet/Object/Keytab.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl/Wallet/Object/Keytab.pm')
-rw-r--r--perl/Wallet/Object/Keytab.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/perl/Wallet/Object/Keytab.pm b/perl/Wallet/Object/Keytab.pm
index 4727590..34eb171 100644
--- a/perl/Wallet/Object/Keytab.pm
+++ b/perl/Wallet/Object/Keytab.pm
@@ -425,7 +425,16 @@ sub enctypes_set {
$self->log_set ('type_data enctypes', $enctype, undef, @trace);
}
}
+
+ # When inserting new enctypes, we unfortunately have to do the
+ # consistency check against the enctypes table ourselves, since SQLite
+ # doesn't enforce integrity constraints.
for my $enctype (keys %enctypes) {
+ $sql = 'select en_name from enctypes where en_name = ?';
+ my $status = $self->{dbh}->selectrow_array ($sql, undef, $enctype);
+ unless ($status) {
+ die "unknown encryption type $enctype\n";
+ }
$sql = 'insert into keytab_enctypes (ke_name, ke_enctype) values
(?, ?)';
$self->{dbh}->do ($sql, undef, $name, $enctype);