You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using OpenSSL 1.1.2301, and I recently got a crash report for X509_check_private_key, but by checking the source, I don't understand where that could come from. Before calling X509_check_private_key, I only call some other conversions methods, but none of them are throwing, so difficult to know if pointers are correctly created. Any clue/advice?
func pkcs12(fromPem pemCertificate:String, withPrivateKey pemPrivateKey:String)throws->NSData{
// Set OpenSSL parameters
OpenSSL_add_all_algorithms()
// Read certificate and private key
letx509CertificateBuffer=BIO_new_mem_buf(pemCertificate,Int32(pemCertificate.count))letx509Certificate=PEM_read_bio_X509(x509CertificateBuffer,nil,nil,nil)letprivateKeyBuffer=BIO_new_mem_buf(pemPrivateKey,Int32(pemPrivateKey.count))letprivateKey=PEM_read_bio_PrivateKey(privateKeyBuffer,nil,nil,nil)defer{BIO_free(x509CertificateBuffer)BIO_free(privateKeyBuffer)X509_free(x509Certificate)}
// Check if private key matches certificate
guardX509_check_private_key(x509Certificate, privateKey)==1else{throwX509Error.privateKeyDoesNotMatchCertificate
}…
The text was updated successfully, but these errors were encountered:
I'm using OpenSSL 1.1.2301, and I recently got a crash report for
X509_check_private_key
, but by checking the source, I don't understand where that could come from. Before callingX509_check_private_key
, I only call some other conversions methods, but none of them are throwing, so difficult to know if pointers are correctly created. Any clue/advice?The text was updated successfully, but these errors were encountered: