From 4c11b77d82030ed1322b120961631aa7a7084add Mon Sep 17 00:00:00 2001 From: ThPryrChn Date: Wed, 20 Jun 2012 21:23:33 -0400 Subject: [PATCH] Added option in Config for unknown devices It is disabled by default, and you just need to remove the # in front of it. --- config.example.yml | 7 ++++++- lib/siriproxy/connection.rb | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config.example.yml b/config.example.yml index fe67ae5..c5f60c8 100644 --- a/config.example.yml +++ b/config.example.yml @@ -39,7 +39,12 @@ hours_till_key_expires: 24 regenerate_interval: 3600 #The try_iPad3 option will let the server use iPad3 keys if there are no 4S keys avaliable. Only works for dictation. -try_iPad3: true +#try_iPad3: true + +#With the allow_unknown_clients option, it allows Aidriod devices, and any other siri ports to use the server. +#It is disabled by default, because it also allows DOS attacks + +#allow_unknown_clients: true #For Generating Certs for iPhones. Has 2 hosts, so that you can use guzzoni on a 4S, #and your server also using the same instance. diff --git a/lib/siriproxy/connection.rb b/lib/siriproxy/connection.rb index 847920f..f811a31 100644 --- a/lib/siriproxy/connection.rb +++ b/lib/siriproxy/connection.rb @@ -592,9 +592,11 @@ def receive_line(line) #Process header #Change unknown to iPhone to make sure everything works.. self.close_connection() #close connections self.other_connection.close_connection() #close other - puts "[Info - SiriProxy] Unknow Device Connected from IP #{self.clientip}" - self.is_4S = false - self.is_iPad3 = false + puts "[Info - SiriProxy] Unknow Device Connected from IP #{self.clientip}" + if $APP_CONFIG.allow_unknown_clients!=true + self.is_4S = false + self.is_iPad3 = false + end @devicetype="Unknown Device" puts "[Info - SiriProxy] Original Header: " + line if $LOG_LEVEL > 2 line = "User-Agent: Assistant(iPhone/iPhone4,1; iPhone OS/5.0.1/9A405) Ace/1.0"