]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Kerberos 5: pretty-print error code when logging
authorPierre Chifflier <chifflier@wzdftpd.net>
Thu, 19 Apr 2018 09:04:01 +0000 (11:04 +0200)
committerPierre Chifflier <chifflier@wzdftpd.net>
Wed, 13 Jun 2018 08:25:40 +0000 (10:25 +0200)
rust/Cargo.toml.in
rust/src/krb/krb5.rs
rust/src/krb/log.rs

index 5e3a411ce682b0300f77fb917300fe37b43ae9fe..470829451e41f768d01ade4c32472c8144fcdb55 100644 (file)
@@ -19,7 +19,7 @@ nom = "~3.2.1"
 libc = "^0.2.36"
 crc = "~1.7.0"
 der-parser = "0.5.2"
-kerberos-parser = "0.1.2"
+kerberos-parser = "0.1.3"
 
 ntp-parser = "0.2.0"
 ipsec-parser = "~0.3.0"
index 24cb8414f22586d90c73f345c251f7c1e88fafd1..d6573ff861d10dd0f5216d767a8464a3d2b8ced6 100644 (file)
@@ -23,7 +23,7 @@ use std::ffi::{CStr,CString};
 use nom::{IResult,be_u32};
 use der_parser::der_read_element_header;
 use kerberos_parser::krb5_parser;
-use kerberos_parser::krb5::{EncryptionType,MessageType,PrincipalName,Realm};
+use kerberos_parser::krb5::{EncryptionType,ErrorCode,MessageType,PrincipalName,Realm};
 use applayer;
 use core;
 use core::{AppProto,Flow,ALPROTO_FAILED,ALPROTO_UNKNOWN,STREAM_TOCLIENT,STREAM_TOSERVER,sc_detect_engine_state_free};
@@ -62,7 +62,7 @@ pub struct KRB5Transaction {
     pub etype: Option<EncryptionType>,
 
     /// Error code, if request has failed
-    pub error_code: Option<i32>,
+    pub error_code: Option<ErrorCode>,
 
     /// The internal transaction id
     id: u64,
index a0768884ba9f3c37f793eb0bf19610d178ba7ddb..c910d11ffc1dd0be1a89f5302f70041f2a8b8a30 100644 (file)
@@ -28,7 +28,7 @@ pub extern "C" fn rs_krb5_log_json_response(_state: &mut KRB5State, tx: &mut KRB
         Some(c) => {
             js.set_string("msg_type", "KRB_ERROR");
             js.set_string("failed_request", &format!("{:?}", tx.msg_type));
-            js.set_string("error_code", &format!("{}", c));
+            js.set_string("error_code", &format!("{:?}", c));
         },
         None    => { js.set_string("msg_type", &format!("{:?}", tx.msg_type)); },
     }