fe0b1a2 Add a PEM validity checker and validate SCEP CA files

Authored and Committed by rcritten 2 years ago
    Add a PEM validity checker and validate SCEP CA files
    
    If a non-PEM file was passed into add-scep-ca it would
    accept it without question but later fail with:
    
    status: CA_UNREACHABLE
    ca-error: Error: failed to verify signature on server response.
    
    Try to do basic validation of user-provided PEM files by:
    
    - stripping BEGIN/END headers
    - removing newlines and carriage returns
    - using OpenSSL EVP library to base64 decode the block
    
    This isn't fool-proof but it at least does some basic
    sanity checking to ensure the file(s) exist and appear
    to be PEM files.
    
    The unit tests use some Let's Encrypt CA certificates.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1492112
    
    Signed-off-by: Rob Crittenden <rcritten@redhat.com>
    
        
file modified
+1 -1
file modified
+2 -0
file modified
+35 -4
file modified
+144 -0
file modified
+7 -0
empty file added
empty file added
file added
+18
file modified
+6 -2
file modified
+2 -1
file added
+69