@@ -678,10 +678,10 @@ async fn get_derived_keys(
678678
679679 let requires_gsp = is_gsp
680680 || response. extended_status_flags . requires_rpc_server ( )
681- || matches ! (
681+ || ( matches ! (
682682 guest_state_encryption_policy,
683683 GuestStateEncryptionPolicy :: GspKey
684- ) ;
684+ ) && strict_encryption_policy ) ;
685685
686686 // If the VMGS is encrypted, but no key protection data is found,
687687 // assume GspById encryption is enabled, but no ID file was written.
@@ -889,18 +889,21 @@ async fn get_derived_keys(
889889 if no_kek && no_gsp {
890890 if matches ! (
891891 guest_state_encryption_policy,
892- GuestStateEncryptionPolicy :: None
892+ GuestStateEncryptionPolicy :: GspById | GuestStateEncryptionPolicy :: Auto
893893 ) {
894+ tracing:: info!( CVM_ALLOWED , "Using GspById" ) ;
895+ } else {
894896 // Log a warning here to indicate that the VMGS state is out of
895897 // sync with the VM's configuration.
896898 //
897- // This should only happen if the VM is configured to
898- // have no encryption, but it already has GspById encryption
899- // and strict encryption policy is disabled.
899+ // This should only happen if strict encryption policy is
900+ // disabled and one of the following is true:
901+ // - The VM is configured to have no encryption, but it already
902+ // has GspById encryption.
903+ // - The VM is configured to use GspKey, but GspKey is not
904+ // available and GspById is.
900905 tracing:: warn!( CVM_ALLOWED , "Allowing GspById" ) ;
901- } else {
902- tracing:: info!( CVM_ALLOWED , "Using GspById" ) ;
903- }
906+ } ;
904907
905908 // Not required for Id protection
906909 key_protector_settings. should_write_kp = false ;
@@ -968,7 +971,7 @@ async fn get_derived_keys(
968971 derived_keys. ingress = ingress_key;
969972 }
970973 } else {
971- tracing:: info!( CVM_ALLOWED , "Using GSP." ) ;
974+ tracing:: info!( CVM_ALLOWED , "Using existing GSP." ) ;
972975
973976 ingress_seed = Some (
974977 gsp_response. decrypted_gsp [ ingress_idx] . buffer
@@ -1034,17 +1037,17 @@ async fn get_derived_keys(
10341037
10351038 if matches ! (
10361039 guest_state_encryption_policy,
1037- GuestStateEncryptionPolicy :: None | GuestStateEncryptionPolicy :: GspById
1040+ GuestStateEncryptionPolicy :: GspKey | GuestStateEncryptionPolicy :: Auto
10381041 ) {
1042+ tracing:: info!( CVM_ALLOWED , "Using Gsp" ) ;
1043+ } else {
10391044 // Log a warning here to indicate that the VMGS state is out of
10401045 // sync with the VM's configuration.
10411046 //
10421047 // This should only happen if the VM is configured to have no
10431048 // encryption or GspById encryption, but it already has GspKey
10441049 // encryption and strict encryption policy is disabled.
10451050 tracing:: warn!( CVM_ALLOWED , "Allowing Gsp" ) ;
1046- } else {
1047- tracing:: info!( CVM_ALLOWED , "Using Gsp" ) ;
10481051 }
10491052
10501053 Ok ( DerivedKeyResult {
0 commit comments