> On 27 Jun 2016, at 12:57, Jens Alfke <j...@mooseyard.com> wrote:
> 
>> On Jun 26, 2016, at 8:13 PM, Gerriet M. Denkmann <gerr...@mdenkmann.de> 
>> wrote:
>> 
>> Assume that an evil entity has got hold of “MyServerCertificate.cer”, but 
>> has no access to my keychain and thus to the private key of 
>> MyServerCertificate. 
>> Could they use this certificate to open a secure stream to a client? Or do 
>> they need the private key to sign?
> 
> — Servers don’t open connections to clients; it’s the other way around.

Sorry, I was speaking rather too loosely.

I meant: when the server accepts a connection from a client via 
        netService:didAcceptConnectionWithInputStream:outputStream: 
it does:
[ inputStream setProperty: settings  forKey: kCFStreamPropertySSLSettings ]

where settings has: kCFStreamSSLCertificates = array with a SecIdentityRef 
obtained via SecItemCopyMatching().

Could it, instead of getting the SecIdentityRef from the keychain, just use 
MyServerCertificate.cer instead?


> — A certificate contains only the public key, not the private key. It can’t 
> be used to sign anything, only to verify signatures.

So this probably answers my question: It could not. (Correct ?).

So the evil server has to use its own EvilServerCertificate from its own 
keychain. 
And then the client would compare the certificate it receives with 
MyServerCertificate.cer and notice that these are different, thus closing the 
connection. (Correct ?)


Kind regards,

Gerriet.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to