5c8f39a Fix writing certificate chain to file

3 files Authored by ftweedal 5 years ago, Committed by cheimes 5 years ago,
    Fix writing certificate chain to file
    
    An client-side error occurs when cert commands are instructed to
    write the certificate chain (--chain option) to a file
    (--certificate-out option).  This regression was introduced in the
    'cert' plugin in commit 5a44ca638310913ab6b0c239374f4b0ddeeedeb3,
    and reflected in the 'ca' plugin in commit
    c7064494e5801d5fd4670e6aab1e07c65d7a0731.
    
    The server behaviour did not change; rather the client did not
    correctly handle the DER-encoded certificates in the
    'certificate_chain' response field.  Fix the issue by treating the
    'certificate' field as base-64 encoded DER, and the
    'certificate_chain' field as an array of raw DER certificates.
    
    Add tests for checking that the relevant commands succeed and write
    PEM data to the file (both with and without --chain).
    
    Fixes: https://pagure.io/freeipa/issue/7700
    Reviewed-By: Christian Heimes <cheimes@redhat.com>
    
        
file modified
+2 -3
file modified
+2 -3