Changeset 1500


Ignore:
Timestamp:
07/09/06 15:01:18 (13 years ago)
Author:
pjkersha
Message:

Testing M2Crypto RSA encryption methods. RSA.check_key call in RSA.public_encrypt causes a segmentation fault.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/Tests/xmlsec/WS-Security/wsSecurity.py

    r1491 r1500  
    399399        # Extract RSA public key from the cert 
    400400        rsaPubKey = x509Cert.get_pubkey().get_rsa() 
    401          
     401 
    402402        data = "The Larch" 
    403         padding = ''.join([' ']*7) 
    404         data += padding 
    405403        encryptedData = rsaPubKey.public_encrypt(data, RSA.pkcs1_padding) 
    406404         
     
    416414                                  callback=lambda *ar, **kw: self.__priKeyPwd) 
    417415         
    418         padding = ''.join([' ']*7) 
    419         decryptedData = priKey.private_decrypt(encryptedData, padding) 
     416        decryptedData = priKey.private_decrypt(encryptedData,  
     417                                               RSA.pkcs1_padding) 
    420418         
    421419        print decryptedData 
     
    430428                          priKeyPwd=open('../../tmp2').read().strip()) 
    431429     
    432     print e.decrypt(e.encrypt(None)) 
     430    encryptedData = e.encrypt(None) 
     431    print e.decrypt(None, encryptedData) 
    433432     
Note: See TracChangeset for help on using the changeset viewer.