def verify_crl(crl, cert):
 if (not salt.utils.which('openssl')):
  raise salt.exceptions.SaltInvocationError('openssl binary not found in path')
 crltext = _text_or_file(crl)
 crltext = get_pem_entry(crltext, pem_type='X509 CRL')
 crltempfile = tempfile.NamedTemporaryFile()
 crltempfile.write(crltext)
 crltempfile.flush()
 certtext = _text_or_file(cert)
 certtext = get_pem_entry(certtext, pem_type='CERTIFICATE')
 certtempfile = tempfile.NamedTemporaryFile()
 certtempfile.write(certtext)
 certtempfile.flush()
 cmd = 'openssl crl -noout -in {0} -CAfile {1}'.format(crltempfile.name, certtempfile.name)
 output = __salt__['cmd.run_stderr'](cmd)
 crltempfile.close()
 certtempfile.close()
 if ('verify OK' in output):
  return True
 else:
  return False

def verify_crl ( crl , cert ) : if ( not salt . utils . which ( 'openssl' ) ) : raise salt . exceptions . SaltInvocationError ( 'openssl binary not found in path' ) crltext = _text_or_file ( crl ) crltext = get_pem_entry ( crltext , pem_type = 'X509 CRL' ) crltempfile = tempfile . NamedTemporaryFile ( ) crltempfile . write ( crltext ) crltempfile . flush ( ) certtext = _text_or_file ( cert ) certtext = get_pem_entry ( certtext , pem_type = 'CERTIFICATE' ) certtempfile = tempfile . NamedTemporaryFile ( ) certtempfile . write ( certtext ) certtempfile . flush ( ) cmd = 'openssl crl -noout -in {0} -CAfile {1}' . format ( crltempfile . name , certtempfile . name ) output = __salt__ [ 'cmd.run_stderr' ] ( cmd ) crltempfile . close ( ) certtempfile . close ( ) if ( 'verify OK' in output ) : return True else : return False
validate a crl against a certificate .