e9acb55 Handle case where we try to use a partially used luksmeta slot

Authored and Committed by scorreia 4 years ago
    Handle case where we try to use a partially used luksmeta slot
    
    In some situations, especially with older versions of clevis, we can end
    up with a partially used luksmeta slot.
    
    We can identify such slots because they will be marked as inactive, yet
    they will contain the clevis UUID, "cb6e8904-81ff-40da-a84a-07ab9ab5715e".
    
    When this situation happens, we have cryptsetup and luksmeta slots "out
    of sync", and since we currently have cryptsetup choose the slot, we may
    end up trying to use such a partially used slot, which in turn will fail
    because luksmeta will not be able to save data to it.
    
    We handle this case by wiping the partially used slot, if we identify
    the situation will arise.
    
    Tests also added to verify this case is handled properly.
    
    Fixes: #70
    
        
file modified
+7 -1