Marino Faggiana 7 years ago
parent
commit
ef8d6d5a6b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      iOSClient/Security/NCEndToEndEncryption.m

+ 5 - 1
iOSClient/Security/NCEndToEndEncryption.m

@@ -445,7 +445,11 @@ cleanup:
     */
     
     BIO *bio = BIO_new_mem_buf(pKey, -1);
-    RSA *rsa = PEM_read_bio_RSA_PUBKEY(bio, NULL, 0, NULL);
+    X509 *x509 = PEM_read_bio_X509(bio, NULL, 0, NULL);
+    EVP_PKEY *evpkey = X509_get_pubkey(x509);
+    RSA *rsa = EVP_PKEY_get1_RSA(evpkey);
+
+//RSA *rsa = PEM_read_bio_RSA_PUBKEY(bio, NULL, 0, NULL);
     BIO_free(bio);
 
     int maxSize = RSA_size(rsa);