Changeset 5271


Ignore:
Timestamp:
12/19/11 14:11:08 (12 years ago)
Author:
rafaelraymundo
Message:

Ticket #2395 - Assinatura/cifragem digital de emails - Suporte a SHA512.

Location:
branches/2.3/security/classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/security/classes/CertificadoB.php

    r4916 r5271  
    113113                while ($erro = openssl_error_string()); //  Limpa buffer de erros anteriores...... 
    114114                $this->erros_ssl = array(); 
    115                 $resultado = openssl_pkcs7_encrypt($m_arquivo_temporario,$enc_arquivo_temporario,$c,$h,$flags=0,$cipherid=OPENSSL_CIPHER_DES); 
     115                // Se he PHP 5.4 , ou maior, usar "OPENSSL_CIPHER_AES_256_CBC" .  
     116                $cipher_id = ((double)phpversion() >= 5.4 ? OPENSSL_CIPHER_AES_256_CBC : OPENSSL_CIPHER_DES); 
     117                $resultado = openssl_pkcs7_encrypt($m_arquivo_temporario,$enc_arquivo_temporario,$c,$h,$flags=0,$cipherid=$cipher_id); 
    116118                //$resultado = openssl_pkcs7_encrypt($m_arquivo_temporario,$enc_arquivo_temporario,$c,$h); 
    117119                if(!$resultado) 
  • branches/2.3/security/classes/funcoes_auxiliares.php

    r5010 r5271  
    14241424                                        break; 
    14251425 
     1426                                case 0x00: 
     1427                                        // Testa se he uma indicacao de fim de dados... 
     1428                                        if(substr($data,0,6) == chr(0x00).chr(0x00).chr(0x00).chr(0x00).chr(0x00).chr(0x00)) 
     1429                                        { 
     1430                                            $data = ''; 
     1431                                            break; 
     1432                                        } 
     1433                                        // Pode ser um novo bloco para parsear... 
     1434                                        if(substr($data,0,2) == chr(0x00).chr(0x00)) 
     1435                                        { 
     1436                                            $data = substr($data, 2); 
     1437                                            $result[] = array('NOVO BLOCO' ,array(Crl_parseASN($data))); 
     1438                                            $data = ''; 
     1439                                            break; 
     1440                                        } 
     1441                                        // Valor fora do contexto. Vai considerar desconhecido... 
     1442                                         
    14261443                                default: 
    14271444                                        // Unknown 
Note: See TracChangeset for help on using the changeset viewer.