check that key data is not empty, and return error otherwise.
authorJameson Rollins <jrollins@finestructure.net>
Fri, 31 Dec 2010 06:29:26 +0000 (01:29 -0500)
committerJameson Rollins <jrollins@finestructure.net>
Fri, 31 Dec 2010 06:29:26 +0000 (01:29 -0500)
Crypt/Monkeysphere/MSVA.pm

index 74c5b17a96715128976f131edf178a0b0bee3824..f2bb7b1108f406dfd46ce014f579ab89f363e733 100755 (executable)
                  message => 'Unknown failure',
                };
 
                  message => 'Unknown failure',
                };
 
+    # check that there actually is key data
+    if ($data->{pkc}->{data} eq '') {
+      $ret->{message} = sprintf("Key data empty.");
+      return $status,$ret;
+    }
+
     # check context string
     if ($data->{context} =~ /^(https|ssh|smtp|ike|postgresql|imaps|imap|submission|e-mail)$/) {
        $data->{context} = $1;
     # check context string
     if ($data->{context} =~ /^(https|ssh|smtp|ike|postgresql|imaps|imap|submission|e-mail)$/) {
        $data->{context} = $1;