@@ -31,6 +31,8 @@ pub static DEFAULT_ENABLE_AGENT_MTLS: bool = true;
3131pub static DEFAULT_KEYLIME_DIR : & str = "/var/lib/keylime" ;
3232pub static DEFAULT_SERVER_KEY : & str = "server-private.pem" ;
3333pub static DEFAULT_SERVER_CERT : & str = "server-cert.crt" ;
34+ pub static DEFAULT_IAK_CERT : & str = "iak-cert.crt" ;
35+ pub static DEFAULT_IDEVID_CERT : & str = "idevid-cert.crt" ;
3436pub static DEFAULT_SERVER_KEY_PASSWORD : & str = "" ;
3537// The DEFAULT_TRUSTED_CLIENT_CA is relative from KEYLIME_DIR
3638pub static DEFAULT_TRUSTED_CLIENT_CA : & str = "cv_ca/cacert.crt" ;
@@ -58,7 +60,7 @@ pub static DEFAULT_EK_HANDLE: &str = "generate";
5860pub static DEFAULT_ENABLE_IAK_IDEVID : bool = true ;
5961pub static DEFAULT_IAK_IDEVID_ASYMMETRIC_ALG : & str = "rsa" ;
6062pub static DEFAULT_IAK_IDEVID_NAME_ALG : & str = "sha256" ;
61- pub static DEFAULT_IAK_IDEVID_TEMPLATE : & str = "" ;
63+ pub static DEFAULT_IAK_IDEVID_TEMPLATE : & str = "H-1 " ;
6264pub static DEFAULT_RUN_AS : & str = "keylime:tss" ;
6365pub static DEFAULT_AGENT_DATA_PATH : & str = "agent_data.json" ;
6466pub static DEFAULT_CONFIG : & str = "/etc/keylime/agent.conf" ;
@@ -78,6 +80,8 @@ pub(crate) struct EnvConfig {
7880 pub keylime_dir : Option < String > ,
7981 pub server_key : Option < String > ,
8082 pub server_cert : Option < String > ,
83+ pub iak_cert : Option < String > ,
84+ pub idevid_cert : Option < String > ,
8185 pub server_key_password : Option < String > ,
8286 pub trusted_client_ca : Option < String > ,
8387 pub enc_keyname : Option < String > ,
@@ -120,6 +124,8 @@ pub(crate) struct AgentConfig {
120124 pub keylime_dir : String ,
121125 pub server_key : String ,
122126 pub server_cert : String ,
127+ pub iak_cert : String ,
128+ pub idevid_cert : String ,
123129 pub server_key_password : String ,
124130 pub trusted_client_ca : String ,
125131 pub enc_keyname : String ,
@@ -199,6 +205,12 @@ impl EnvConfig {
199205 if let Some ( ref v) = self . server_cert {
200206 _ = agent. insert ( "server_cert" . to_string ( ) , v. to_string ( ) . into ( ) ) ;
201207 }
208+ if let Some ( ref v) = self . iak_cert {
209+ _ = agent. insert ( "iak_cert" . to_string ( ) , v. to_string ( ) . into ( ) ) ;
210+ }
211+ if let Some ( ref v) = self . idevid_cert {
212+ _ = agent. insert ( "idevid_cert" . to_string ( ) , v. to_string ( ) . into ( ) ) ;
213+ }
202214 if let Some ( ref v) = self . trusted_client_ca {
203215 _ = agent. insert (
204216 "trusted_client_ca" . to_string ( ) ,
@@ -395,6 +407,14 @@ impl Source for KeylimeConfig {
395407 "server_cert" . to_string ( ) ,
396408 self . agent . server_cert . to_string ( ) . into ( ) ,
397409 ) ;
410+ _ = m. insert (
411+ "iak_cert" . to_string ( ) ,
412+ self . agent . iak_cert . to_string ( ) . into ( ) ,
413+ ) ;
414+ _ = m. insert (
415+ "idevid_cert" . to_string ( ) ,
416+ self . agent . idevid_cert . to_string ( ) . into ( ) ,
417+ ) ;
398418 _ = m. insert (
399419 "trusted_client_ca" . to_string ( ) ,
400420 self . agent . trusted_client_ca . to_string ( ) . into ( ) ,
@@ -544,6 +564,8 @@ impl Default for AgentConfig {
544564 server_key : "default" . to_string ( ) ,
545565 server_key_password : DEFAULT_SERVER_KEY_PASSWORD . to_string ( ) ,
546566 server_cert : "default" . to_string ( ) ,
567+ iak_cert : "default" . to_string ( ) ,
568+ idevid_cert : "default" . to_string ( ) ,
547569 trusted_client_ca : "default" . to_string ( ) ,
548570 revocation_actions : DEFAULT_REVOCATION_ACTIONS . to_string ( ) ,
549571 revocation_actions_dir : DEFAULT_REVOCATION_ACTIONS_DIR
@@ -724,6 +746,20 @@ fn config_translate_keywords(
724746 . collect :: < Vec < _ > > ( )
725747 . join ( ", " ) ;
726748
749+ let mut iak_cert = config_get_file_path (
750+ "iak_cert" ,
751+ & config. agent . iak_cert ,
752+ keylime_dir,
753+ DEFAULT_IAK_CERT ,
754+ ) ;
755+
756+ let mut idevid_cert = config_get_file_path (
757+ "idevid_cert" ,
758+ & config. agent . idevid_cert ,
759+ keylime_dir,
760+ DEFAULT_IDEVID_CERT ,
761+ ) ;
762+
727763 let ek_handle = match config. agent . ek_handle . as_ref ( ) {
728764 "generate" => "" . to_string ( ) ,
729765 "" => "" . to_string ( ) ,
@@ -764,6 +800,8 @@ fn config_translate_keywords(
764800 uuid,
765801 server_key,
766802 server_cert,
803+ iak_cert,
804+ idevid_cert,
767805 trusted_client_ca,
768806 ek_handle,
769807 agent_data_path,
0 commit comments