Raised This Month: $ Target: $400
 0% 

Updater


Post New Thread Reply   
 
Thread Tools Display Modes
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-11-2014 , 14:16   Re: Updater
Reply With Quote #411

You'll need to attach a zip file of sources for that binary.

SteamTools already support HTTPS, cURL should as well without needing that flag unless you're talking to broken servers.
__________________
asherkin is offline
Nefarius
Member
Join Date: Sep 2010
Old 04-11-2014 , 14:22   Re: Updater
Reply With Quote #412

Added source code.

Like I said; Github as an example will not handshake with clients using protocol version lower than SSL v3 (TLS v1) and the default option set in cURL will just cancel the request with an error. These are not "broken" servers but server who ensure they won't leak information to older clients supporting only old and probably vulnerable protocol versions.

Ah, I stand corrected, after a bit of research there really seems to be a problem with Github not graciously downgrading from TLS 1.0/1.1/1.2 to SSLv3 automatically, how odd!
__________________
Let the future tell the truth and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I really worked, is mine.
- Nikola Tesla

Last edited by Nefarius; 04-11-2014 at 14:30.
Nefarius is offline
Lordearon
Member
Join Date: Jan 2013
Location: Vietnam
Old 04-12-2014 , 01:20   Re: Updater
Reply With Quote #413

Thank you, I'm just curious about the case where DNS can't be guaranteed

with all the router hacks I read about these days
__________________
iGame.vn

Last edited by Lordearon; 04-12-2014 at 01:25.
Lordearon is offline
Nefarius
Member
Join Date: Sep 2010
Old 04-12-2014 , 12:47   Re: Updater
Reply With Quote #414

If you consistently use SSL and your Clients strictly validates the certificate against an official CA (VeriSign, COMODO, StartSSL and so on) you are pretty safe against DNS spoofing attacks (I'm simplifying it a bit, in reality it's more complicated but I won't go in to deep) because the target host name has to match the certificates "distinguished name". If someone on your network gained access to the DNS system your server uses to resolve names and redirects traffic from your client to himself (faking the real update website) this validation would fail because only the real owner of the official update site has the corresponding private key and no connection would be established. This only works if the private key really remains secret (which can't be assured for old certificates since the heartbleed disaster) and the client won't skip the peer/host validation.

I hope this wasn't worded too complicated, long story short: SSL also protects against spoofed DNS requests (as long as it's set up properly)
__________________
Let the future tell the truth and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I really worked, is mine.
- Nikola Tesla
Nefarius is offline
Lordearon
Member
Join Date: Jan 2013
Location: Vietnam
Old 04-13-2014 , 00:01   Re: Updater
Reply With Quote #415

to get VeriSign certs you have to pay

I think it would be way easier if there is an RSA keypair, the plugin author keeps the secret key and generates a signature for the updater plugin to check with the public key. When you install a plugin, you provide the author public key with it so you can validate the downloaded plugin comes from the right source.

a dns hack won't be able to insert evil soucemod addons
__________________
iGame.vn
Lordearon is offline
Nefarius
Member
Join Date: Sep 2010
Old 04-13-2014 , 04:21   Re: Updater
Reply With Quote #416

Quote:
Originally Posted by Lordearon View Post
to get VeriSign certs you have to pay
That's not a valid excuse if you are serious about what you are doing A three year wildcard(!) multi-domain certificate from StartSSL costs 60$/2yrs! I use them since 2008 if I remember correctly and it works perfectly in all (modern) browsers and other clients.

Signing the files would need an implementation for SourceMod to check (like an OpenSSL extension) and a few modifications on Updater, while HTTPS would ensure transport security and is easier to implement as long as people use SteamTools or cURL.
__________________
Let the future tell the truth and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I really worked, is mine.
- Nikola Tesla
Nefarius is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 04-13-2014 , 12:19   Re: Updater
Reply With Quote #417

Quote:
Originally Posted by Nefarius View Post
That's not a valid excuse if you are serious about what you are doing A three year wildcard(!) multi-domain certificate from StartSSL costs 60$/2yrs! I use them since 2008 if I remember correctly and it works perfectly in all (modern) browsers and other clients.

Signing the files would need an implementation for SourceMod to check (like an OpenSSL extension) and a few modifications on Updater, while HTTPS would ensure transport security and is easier to implement as long as people use SteamTools or cURL.
Three year two years?

I think that using a type of signature system would work better. Requiring SSL is not compatible with Updater as it is now, since the Socket extension doesn't support it. Signatures would also allow for binaries supplied from other sources to be linked back to a trusted key.
__________________
Dr. McKay is offline
Nefarius
Member
Join Date: Sep 2010
Old 04-13-2014 , 14:14   Re: Updater
Reply With Quote #418

Quote:
Originally Posted by Dr. McKay View Post
Three year two years?
You pay once for your personal verification (so they know you are really you) and then you can request a certificate which will stay valid for two years. If I remember correctly you can expand to three years with one additional validation step (costing a bit more ofc.).

As for the signing of files; it's possible to achieve with OpenSSL:
  1. Generate new private key called nefarius.key (this file must be kept secret!)
    • openssl genrsa -out nefarius.key 2048
  2. Extract public key nefarius.pub (this file gets distributed to the clients)
    • openssl rsa -in nefarius.key -pubout > nefarius.pub
  3. Create a hash of your plugin file
    • openssl dgst -sha256 plugin.smx > plugin.sha
  4. Sign the hash with your private(!) key
    • openssl rsautl -sign -inkey nefarius.key -out plugin.sha.rsa -in plugin.sha
  5. Transfer nefarius.pub, plugin.smx and plugin.sha.rsa to your client(s)
  6. Client verifies signed hash file
    • openssl rsautl -verify -inkey nefarius.pub -in plugin.sha.rsa -pubin > plugin.sha
  7. Client generates hash of downloaded plugin.smx
    • openssl dgst -sha256 plugin.smx > plugin.sha.tmp
  8. Client compares contents of plugin.sha and plugin.sha.tmp
    • If they don't match, the file has been manipulated. Discard file, log action, call police etc.
    • If they match, accept and install the file

A plugin using this may use the System2 extension to run the openssl command. This requires openssl being present in the system path ofc. or a static build of openssl is shipped with the plugin.
__________________
Let the future tell the truth and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I really worked, is mine.
- Nikola Tesla
Nefarius is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-13-2014 , 14:15   Re: Updater
Reply With Quote #419

Quote:
Originally Posted by Nefarius View Post
or a static build of openssl is shipped with the plugin.
...for all 3 OSes SourceMod supports.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Nefarius
Member
Join Date: Sep 2010
Old 04-13-2014 , 14:16   Re: Updater
Reply With Quote #420

Never mind, I think I misunderstood your comment. Ofc. a build compatible with all operating systems

Linux will - in most cases - not be a problem, I just tested it with a static build for Windows:

__________________
Let the future tell the truth and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I really worked, is mine.
- Nikola Tesla

Last edited by Nefarius; 04-13-2014 at 14:33.
Nefarius is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode