src/network/ssl/qsslkey.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
equal deleted inserted replaced
18:2f34d5167611 19:fcece45ef507
   117 
   117 
   118     BIO *bio = q_BIO_new_mem_buf(const_cast<char *>(pem.data()), pem.size());
   118     BIO *bio = q_BIO_new_mem_buf(const_cast<char *>(pem.data()), pem.size());
   119     if (!bio)
   119     if (!bio)
   120         return;
   120         return;
   121 
   121 
   122     void *phrase = passPhrase.isEmpty()
   122     void *phrase = (void *)passPhrase.constData();
   123         ? (void *)0
       
   124         : (void *)passPhrase.constData();
       
   125 
   123 
   126     if (algorithm == QSsl::Rsa) {
   124     if (algorithm == QSsl::Rsa) {
   127         RSA *result = (type == QSsl::PublicKey)
   125         RSA *result = (type == QSsl::PublicKey)
   128             ? q_PEM_read_bio_RSA_PUBKEY(bio, &rsa, 0, phrase)
   126             ? q_PEM_read_bio_RSA_PUBKEY(bio, &rsa, 0, phrase)
   129             : q_PEM_read_bio_RSAPrivateKey(bio, &rsa, 0, phrase);
   127             : q_PEM_read_bio_RSAPrivateKey(bio, &rsa, 0, phrase);