Open p-barabas opened 5 years ago
@p-barabas Have you got any solution?
Yes, it is in private repo since I needed to make a lot of changes in mailcore and libetpan in order to be able to build on Android 23+. The pinning is easier, only mailcore code should be changed: the public key or hash need to be set into mailcore an in src/core/security/MCCertificateUtils.cpp you can compute the pin for public key in incoming stream and compare with stored. On iOS you can use Security framework, on Android openssl is the winner.
The client certificate authentication is a bit more difficult, since you should pass the client certificate to libetpan through mailimap.c and mailsmtp.c and in src/low-level/imap/mailimap_ssl.c and in src/low-level/smtp/mailsmtp_ssl.c you could use the client certificate and password and pass to mailstream.
@p-barabas Thanks for the information.
@p-barabas would you be able to send pull requests for the changes you needed to make to get it working on Android properly?
Hi @p-barabas we have tried above changes but unable to get success in pinning. Can you share some code for same? It will be helpful. Thank you
I had no time to cleanup the code and structure but I pushed changed into libetpan and mailcore2 forks. The pinning and client certificate authentication code are clean. I made two pull requests for libetpan and mailcore2. Please review and cleanup the structure (mainly the dependency management). There were a lot of work with dependencies in order to be built on Android 23+ because of NDK.