Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge gemify

Conflicts:
	README.md
  • Loading branch information...
commit 66c496db3675fcbe2a9420f8accf8b790a4a22f0 2 parents 69f230a + 71794bc
@netpro2k netpro2k authored
View
3  .gitignore
@@ -6,3 +6,6 @@ newkey.pem
newreq.pem
config.yml
Gemfile.lock
+*.gem
+.bundle
+pkg/*
View
8 Gemfile
@@ -1,21 +1,19 @@
source :gemcutter
-gem 'CFPropertyList'
-gem 'eventmachine'
-gem 'uuidtools'
+gemspec
# load plugins
require 'yaml'
require 'ostruct'
-if !File.exists?('config.yml')
+if !File.exists?(File.expand_path('~/.siriproxy/config.yml'))
$stderr.puts "config.yml not found. Copy config.example.yml to config.yml, then modify it."
exit 1
end
gem 'cora', :git => "git://github.com/chendo/cora.git"
-config = OpenStruct.new(YAML.load_file('config.yml'))
+config = OpenStruct.new(YAML.load_file(File.expand_path('~/.siriproxy/config.yml')))
if config.plugins
config.plugins.each do |plugin|
if plugin.is_a? String
View
138 README.md
@@ -12,7 +12,7 @@ Notice About Plugins
We recently changed the way plugins work very significantly. That being the case, your old plugins won't work.
-New plugins should be independent Gems. Take a look at the included sample plugin (plugins/siriproxy-example) for some inspiration. We will try to keep that file up to date with the latest features.
+New plugins should be independent Gems. Take a look at the included [example plugin](https://github.com/plamoni/SiriProxy/tree/master/plugins/siriproxy-example) for some inspiration. We will try to keep that file up to date with the latest features.
The State of This Project
-------------------------
@@ -25,66 +25,80 @@ Find us on IRC
We now have an IRC channel. Check out the #SiriProxy channel on irc.freenode.net.
-Demo Videos
+Demo Video
-----------
See the system in action here: [http://www.youtube.com/watch?v=AN6wy0keQqo](http://www.youtube.com/watch?v=AN6wy0keQqo)
-See it running with the ELIZA plugin here: [http://www.youtube.com/watch?v=uTiLverShyc](http://www.youtube.com/watch?v=uTiLverShyc)
+More Demo Videos and Other Plugins
+----------------------------------
-Other Plugins
--------------
+For a list of current plugins and some more demo videos, check the [Plugins page](https://github.com/plamoni/SiriProxy/wiki/Plugins) on the wiki.
-While we encourage people to create SiriProxy plguins, please note that the project is still in very early stages and the **plugin API is still in flux** and may undergo radical changes.
-
-**Sam Lu's Hockey Scores plugin**
-Source: [https://github.com/senmu/SiriProxy-HockeyScores](https://github.com/senmu/SiriProxy-HockeyScores)
-Video: [http://vimeo.com/32431965](http://vimeo.com/32431965)
-
-**Dominick D'Aniello's Twitter plugin (now integrated into main trunk)**
-Source: [https://github.com/plamoni/SiriProxy/blob/master/plugins/twitter/siriTweet.rb](https://github.com/plamoni/SiriProxy/blob/master/plugins/twitter/siriTweet.rb)
-Video: [http://www.youtube.com/watch?v=kM7Th-zcCSc](http://www.youtube.com/watch?v=kM7Th-zcCSc)
+Set-up Instructions
+-------------------
-**Ninja0091's Dreambox plugin**
-Source: (don't have it yet)
-Video: [http://www.youtube.com/watch?v=jke2bl7Vkbo](http://www.youtube.com/watch?v=jke2bl7Vkbo)
+**Set up DNS**
-**Hjaltij's Plex plugin**
-Source: [https://github.com/hjaltij/SiriProxy/](https://github.com/hjaltij/SiriProxy/)
-Video: [http://www.youtube.com/watch?v=eChSxAxcxUE](http://www.youtube.com/watch?v=eChSxAxcxUE)
+Before you can use SiriProxy, you must set up a DNS server on your network to forward requests for guzzoni.apple.com to the computer running the proxy (make sure that computer is not using your DNS server!). I recommend dnsmasq for this purpose. It's easy to get running and can easily handle this sort of behavior. ([http://www.youtube.com/watch?v=a9gO4L0U59s](http://www.youtube.com/watch?v=a9gO4L0U59s))
-Set-up Instructions
--------------------
+**Set up RVM and Ruby 1.9.3**
-Currently, setup requires a pretty solid knowledge of certificates and openssl (or some good skills with Google). I'll see about providing automated scripts for generating the CA and relavent cert soon.
+If you don't already have Ruby 1.9.3 installed through RVM, please do so in order to make sure you can follow the steps later. Experts can ignore this. If you're unsure, follow these directions carefully:
-1. Create a root CA using open SSL and have it issue a signed certificate for guzzoni.apple.com. Save the guzzoni private key (no passphrase) and certificate as "server.passless.key" and "server.passless.crt" in the SiriProxy directory. ([http://www.youtube.com/watch?v=_oaNbPOUCaE](http://www.youtube.com/watch?v=_oaNbPOUCaE))
-2. Load the root CA's public certificate on your phone (you can just email it to yourself and click it to do that).
-3. Set up a DNS server on your network to forward requests for guzzoni.apple.com to the computer running the proxy (make sure that computer is not using your DNS server!). I recommend dnsmasq for this purpose. It's easy to get running and can easily handle this sort of behavior. ([http://www.youtube.com/watch?v=a9gO4L0U59s](http://www.youtube.com/watch?v=a9gO4L0U59s))
-4. For best results, we recommend using RVM to manage ruby versions and gemsets. For instructions on installing RVM visit [http://beginrescueend.com/](http://beginrescueend.com/).
-5. Use RVM to install ruby 1.9.3
+1. Download and install RVM (if you don't have it already):
+ * Download/install RVM:
+ `bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)`
+ * Activate RVM:
+ `[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"`
+ * (optional, but useful) Add RVM to your .bash_profile:
+ `echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile`
+2. Install Ruby 1.9.3 (if you don't have it already):
+ `rvm install 1.9.3`
+3. Set RVM to use/default to 1.9.3:
+ `rvm use 1.9.3 --default`
+
+**Set up SiriProxy**
- `$ rvm install 1.9.3`
- (`$ rvm install 1.9.3 --with-gcc=clang` on some OS X Lion machines)
+Clone this repo locally, then navigate into the SiriProxy directory (the root of the repo). Then follow these instructions carefully. Note that nothing needs to be (or should be) done as root until you launch the server:
- and switch to it
+1. Install Rake and Bundler:
+ `rvmsudo gem install rake bundler`
+2. Install SiriProxy gem (do this from your SiriProxy directory):
+ `rake install`
+3. Make .siriproxy directory:
+ `mkdir ~/.siriproxy`
+4. Move default config file to .siriproxy (if you need to make configuration changes, do that now by editing the config.yml):
+ `cp ./config.example.yml ~/.siriproxy/config.yml`
+5. Generate certificates:
+ `siriproxy gencerts`
+6. Install `~/.siriproxy/ca.pem` on your phone. This can easily be done by emailing the file to yourself and clicking on it in the iPhone email app. Follow the prompts.
+7. Bundle SiriProxy (this should be done every time you change the config.yml):
+ `siriproxy bundle`
+8. Start SiriProxy (must start as root because it uses a port < 1024):
+ `rvmsudo siriproxy server`
+9. Test that the server is running by saying "Text Siri Proxy" to your phone.
- `$ rvm use 1.9.3`
+Note: on some machines, rvmsudo changes "`~`" to "`/root/`". This means that you may need to symlink your "`.siriproxy`" directory to "`/root/`" in order to get the application to work:
-6. Install bundler *(should already be installed if you did step 4)*
+ sudo ln -s ~/.siriproxy /root/.siriproxy
- `$ gem install bundler`
+**Updating SiriProxy**
-7. Edit config.yml and enable some plugins by uncommenting them
-8. Install the requisite Ruby gems with bundler:
+Once you're up and running, if you modify the code, or you want to grab the latest code from GitHub, you can do that easily using the "siriproxy update" command. Here's a couple of examples:
- `$ bundle install`
-
-9. Execute start.rb (as root -- since it must listen on TCP/443)
+ siriproxy update
+
+Installs the latest code from the [master] branch on GitHub.
+
+ siriproxy update /path/to/SiriProxy
- `$ rvmsudo ruby start.rb`
+Installs the code from /path/to/SiriProxy
+
+ siriproxy update -b gemify
-10. Activate Siri on your phone (connected to the network and using the DNS server with the fake entry), and say, "Test Siri proxy." It should respond, "Siri Proxy is up and running!"
+Installs the latest code from the [gemify] branch on GitHub
+
FAQ
---
@@ -95,45 +109,7 @@ No. Please stop asking.
**How do I generate the certificate?**
-Here's some quick(-ish) steps on generating the fake CA and Guzzoni cert (on a Mac):
-
-1. Open a terminal (go to spotlight, type "terminal")
-2. Type:
-
- `/System/Library/OpenSSL/misc/CA.pl -newca
-3. Enter the following information:
-
- * CA certificate filename: hit enter, it will create a "demoCA" folder
- * Enter PEM pass phrase: give it something 4+ characters that you'll remember. Doesn't need to be complicated
- * Information (Country Name, State Name, etc): Just enter whatever. It's not important
- * Common Name: For the CA, this can be whatever. For the guzzoni certificate, it MUST be: "guzzoni.apple.com"
-
-4. Type:
-
- `/System/Library/OpenSSL/misc/CA.pl -newreq`
-
-5. Repeat step 3. Make sure you enter "guzzoni.apple.com" as your Common Name.
-6. Type:
-
- `/System/Library/OpenSSL/misc/CA.pl -sign`
-
-7. Enter the passphrase from the first time you did step 3.
-8. Type "y" in response to each prompt.
-9. Type:
-
- `openssl rsa -in newkey.pem -out server.passless.key`
-
-10. Enter your passphrase from the second time you did step 3.
-11. Type:
-
- `mv newcert.pem server.passless.crt`
-
-12. Move server.passless.crt and server.passless.key to your Siri Proxy server.
-13. Email cacert.pem from your demoCA folder (created in step 2) to your iPhone. Once it's there, click it and accept it (it will give you scary warnings about this -- it should).
-
-That's it! If you're more of a "follow a video" kind of person, here's a video demonstration of these steps:
-
-[http://www.youtube.com/watch?v=_oaNbPOUCaE](http://www.youtube.com/watch?v=_oaNbPOUCaE)
+Certificates can now be easily generated using `siriproxy gencerts` once you install the SiriProxy gem. See the instructions above.
**How do I set up a DNS server to forward Guzzoni.apple.com traffic to my computer?**
@@ -155,7 +131,7 @@ You're probably not using an iPhone 4S. You need to be using an iPhone 4S (or ha
**How do I remove the certificate from my iPhone when I'm done?**
-Just go into your phone's Settings app, then go to "General->Profiles." Your CA will probably be the only thing listed under "Configuration Profiles." It will be listed as its "Common Name." Just click it and click "Remove" and it will be removed. (Thanks to [@tidegu](http://www.twitter.com/tidegu) for asking!)
+Just go into your phone's Settings app, then go to "General->Profiles." Your CA will probably be the only thing listed under "Configuration Profiles." It will be listed as "SiriProxyCA" Just click it and click "Remove" and it will be removed. (Thanks to [@tidegu](http://www.twitter.com/tidegu) for asking!)
**Does this require a jailbreak?**
View
3  Rakefile
@@ -1,8 +1,9 @@
require 'rake'
require 'rake/testtask'
+require "bundler/gem_tasks"
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/*.rb']
t.verbose = true
-end
+end
View
6 bin/siriproxy
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
+
+require 'siriproxy/command_line'
+
+SiriProxy::CommandLine.new
View
33 gen_certs.zsh
@@ -1,33 +0,0 @@
-#!/usr/bin/env zsh
-
-
-# Feel free to change any of these defaults
-countryName="UK"
-stateOrProvinceName="England"
-localityName=""
-organizationName="Siri Proxy"
-organizationalUnitName=""
-commonName="SiriProxy"
-emailAddress=""
-
-## Do not edit below here!
-echo "Ok, before we get going you need to know a few things"
-echo "You're about to be asked four questions, the answers are: 1234, 1234, y, y"
-echo -n "Hit return to continue!"; read -e
-
-mkdir -p demoCA/{certs,crl,newcerts,private}
-touch demoCA/index.txt
-echo 01 > demoCA/crtnumber
-
-CAREQARGS="${countryName}\n${stateOrProvinceName}\n${localityName}\n${organizationName}\n${organizationalUnitName}\n${commonName}\n${emailAddress}\n\n\n"
-echo -n $CAREQARGS | openssl req -new -keyout demoCA/private/cakey.pem -out demoCA/careq.pem -passin pass:1234 -passout pass:1234
-openssl ca -create_serial -out demoCA/cacert.pem -days 1095 -batch -keyfile demoCA/private/cakey.pem -selfsign -extensions v3_ca -infiles demoCA/careq.pem
-
-CRTREQARGS="${countryName}\n${stateOrProvinceName}\n${localityName}\n${organizationName}\n${organizationalUnitName}\nguzzoni.apple.com\n${emailAddress}\n\n\n"
-echo $CRTREQARGS | openssl req -new -keyout newkey.pem -out newreq.pem -days 1095 -passin pass:1234 -passout pass:1234
-openssl ca -policy policy_anything -out newcert.pem -infiles newreq.pem
-openssl rsa -in newkey.pem -out server.passless.key -passin pass:1234
-
-mv newcert.pem server.passless.crt
-mv demoCA/cacert.pem ca.pem
-rm -rf new{key,req}.pem demoCA
View
49 interpret_siri.rb
@@ -1,49 +0,0 @@
-######
-# The idea behind this class is that you can call the different
-# methods to get different interpretations of a Siri object.
-# For instance, you can "unknown_intent" and it will check
-# to see if an object is a "Common#unknownIntent" response and
-# call the provided processor method with the appropriate info.
-# processor method signatures are provided in comments above each
-# method.
-#
-# each method will return "nil" if the object is not the valid
-# type. If it is, it will return the result of the processor.
-#####
-class InterpretSiri
- #Checks if the object is Guzzoni responding that it can't
- #determine the intent of the query
- #processor(object, connection, unknown_text)
- def unknown_intent(object, connection, processor)
- return false if object == nil
- return false if (!(object["properties"]["views"][0]["properties"]["dialogIdentifier"] == "Common#unknownIntent") rescue true)
-
- searchUtterance = object["properties"]["views"][1]["properties"]["commands"][0]["properties"]["commands"][0]["properties"]["utterance"]
- searchText = searchUtterance.split("^")[3]
- return processor.call(object, connection, searchText)
-
- return false
- end
-
- #Checks if the object is Guzzoni responding that it recognized
- #speech. Sends "best interpretation" phrase to processor
- #processor(object, connection, phrase)
- def speech_recognized(object)
- return nil if object == nil
- return nil if (!(object["class"] == "SpeechRecognized") rescue true)
- phrase = ""
-
- object["properties"]["recognition"]["properties"]["phrases"].map { |phraseObj|
- phraseObj["properties"]["interpretations"].first["properties"]["tokens"].map { |token|
- tokenProps = token["properties"]
-
- phrase = phrase[0..-2] if tokenProps["removeSpaceBefore"]
- phrase << tokenProps["text"]
- phrase << " " if !tokenProps["removeSpaceAfter"]
- }
- }
-
- phrase
- end
-
-end
View
0  siri_objects.rb → lib/siri_objects.rb
File renamed without changes
View
13 siri_proxy.rb → lib/siriproxy.rb
@@ -1,8 +1,6 @@
require 'eventmachine'
require 'zlib'
require 'pp'
-# require 'tweakSiri'
-require 'interpret_siri'
class String
def to_hex(seperator=" ")
@@ -13,17 +11,19 @@ def to_hex(seperator=" ")
class SiriProxy
def initialize()
+ # @todo shouldnt need this, make centralize logging instead
+ $LOG_LEVEL = $APP_CONFIG.log_level.to_i
EventMachine.run do
begin
- puts "Starting SiriProxy on port #{APP_CONFIG.port}.."
- EventMachine::start_server('0.0.0.0', APP_CONFIG.port, SiriProxy::Connection::Iphone) { |conn|
+ puts "Starting SiriProxy on port #{$APP_CONFIG.port}.."
+ EventMachine::start_server('0.0.0.0', $APP_CONFIG.port, SiriProxy::Connection::Iphone) { |conn|
$stderr.puts "start conn #{conn.inspect}"
conn.plugin_manager = SiriProxy::PluginManager.new()
conn.plugin_manager.iphone_conn = conn
}
rescue RuntimeError => err
if err.message == "no acceptor"
- raise "Cannot start the server on port #{APP_CONFIG.port} - are you root, or have another process on this port already?"
+ raise "Cannot start the server on port #{$APP_CONFIG.port} - are you root, or have another process on this port already?"
else
raise
end
@@ -31,6 +31,3 @@ def initialize()
end
end
end
-
-Interpret = InterpretSiri.new
-
View
184 lib/siriproxy/command_line.rb
@@ -0,0 +1,184 @@
+require 'optparse'
+require 'yaml'
+require 'ostruct'
+
+# @todo want to make SiriProxy::Commandline without having to
+# require 'siriproxy'. Im sure theres a better way.
+class SiriProxy
+
+end
+
+class SiriProxy::CommandLine
+ BANNER = <<-EOS
+Siri Proxy is a proxy server for Apple's Siri "assistant." The idea is to allow for the creation of custom handlers for different actions. This can allow developers to easily add functionality to Siri.
+
+See: http://github.com/plamoni/SiriProxy/
+
+Usage: siriproxy COMMAND OPTIONS
+
+Commands:
+server Start up the Siri proxy server
+gencerts Generate a the certificates needed for SiriProxy
+bundle Install any dependancies needed by plugins
+console Launch the plugin test console
+update [dir] Updates to the latest code from GitHub or from a provided directory
+help Show this usage information
+
+Options:
+ Option Command Description
+ EOS
+
+ def initialize
+ @branch = nil
+ parse_options
+ command = ARGV.shift
+ subcommand = ARGV.shift
+ case command
+ when 'server' then run_server(subcommand)
+ when 'gencerts' then gen_certs
+ when 'bundle' then run_bundle(subcommand)
+ when 'console' then run_console
+ when 'update' then update(subcommand)
+ when 'help' then usage
+ else usage
+ end
+ end
+
+ def run_console
+ load_code
+ $LOG_LEVEL = 0
+ # this is ugly, but works for now
+ SiriProxy::PluginManager.class_eval do
+ def respond(text, options={})
+ puts "=> #{text}"
+ end
+ def process(text)
+ super(text)
+ end
+ def send_request_complete_to_iphone
+ end
+ def no_matches
+ puts "No plugin responded"
+ end
+ end
+ SiriProxy::Plugin.class_eval do
+ def last_ref_id
+ 0
+ end
+ def send_object(object, options={:target => :iphone})
+ puts "=> #{object}"
+ end
+ end
+
+ cora = SiriProxy::PluginManager.new
+ repl = -> prompt { print prompt; cora.process(gets.chomp!) }
+ loop { repl[">> "] }
+ end
+
+ def run_bundle(subcommand='')
+ setup_bundler_path
+ puts `bundle #{subcommand} #{ARGV.join(' ')}`
+ end
+
+ def run_server(subcommand='start')
+ load_code
+ start_server
+ # @todo: support for forking server into bg and start/stop/restart
+ # subcommand ||= 'start'
+ # case subcommand
+ # when 'start' then start_server
+ # when 'stop' then stop_server
+ # when 'restart' then restart_server
+ # end
+ end
+
+ def start_server
+ proxy = SiriProxy.new
+ proxy.start()
+ end
+
+ def gen_certs
+ command = File.join(File.dirname(__FILE__), '..', "..", "scripts", 'gen_certs.sh')
+ sp_root = File.join(File.dirname(__FILE__), '..', "..")
+ puts `#{command} "#{sp_root}"`
+ end
+
+ def update(directory=nil)
+ if(directory)
+ puts "=== Installing from '#{directory}' ==="
+ puts `cd #{directory} && rake install`
+ puts "=== Bundling ===" if $?.exitstatus == 0
+ puts `siriproxy bundle` if $?.exitstatus == 0
+ puts "=== SUCCESS ===" if $?.exitstatus == 0
+
+ exit $?.exitstatus
+ else
+ branch_opt = @branch ? "-b #{@branch}" : ""
+ @branch = "master" if @branch == nil
+ puts "=== Installing latest code from git://github.com/plamoni/SiriProxy.git [#{@branch}] ==="
+
+ tmp_dir = "/tmp/SiriProxy.install." + (rand 9999).to_s.rjust(4, "0")
+
+ `mkdir -p #{tmp_dir}`
+ puts `git clone #{branch_opt} git://github.com/plamoni/SiriProxy.git #{tmp_dir}` if $?.exitstatus == 0
+ puts "=== Performing Rake Install ===" if $?.exitstatus == 0
+ puts `cd #{tmp_dir} && rake install` if $?.exitstatus == 0
+ puts "=== Bundling ===" if $?.exitstatus == 0
+ puts `siriproxy bundle` if $?.exitstatus == 0
+ puts "=== Cleaning Up ===" and puts `rm -rf #{tmp_dir}` if $?.exitstatus == 0
+ puts "=== SUCCESS ===" if $?.exitstatus == 0
+
+ exit $?.exitstatus
+ end
+ end
+
+ def usage
+ puts "\n#{@option_parser}\n"
+ end
+
+ private
+
+ def parse_options
+ $APP_CONFIG = OpenStruct.new(YAML.load_file(File.expand_path('~/.siriproxy/config.yml')))
+ @branch = nil
+ @option_parser = OptionParser.new do |opts|
+ opts.on('-p', '--port PORT', '[server] port number for server (central or node)') do |port_num|
+ $APP_CONFIG.port = port_num
+ end
+ opts.on('-l', '--log LOG_LEVEL', '[server] The level of debug information displayed (higher is more)') do |log_level|
+ $APP_CONFIG.log_level = log_level
+ end
+ opts.on('-b', '--branch BRANCH', '[update] Choose the branch to update from (default: master)') do |branch|
+ @branch = branch
+ end
+ opts.on_tail('-v', '--version', ' show version') do
+ require "siriproxy/version"
+ puts "SiriProxy version #{SiriProxy::VERSION}"
+ exit
+ end
+ end
+ @option_parser.banner = BANNER
+ @option_parser.parse!(ARGV)
+ end
+
+ def setup_bundler_path
+ require 'pathname'
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../../Gemfile",
+ Pathname.new(__FILE__).realpath)
+ end
+
+ def load_code
+ setup_bundler_path
+
+ require 'bundler'
+ require 'bundler/setup'
+
+ require 'siriproxy'
+ require 'siriproxy/connection'
+ require 'siriproxy/connection/iphone'
+ require 'siriproxy/connection/guzzoni'
+
+ require 'siriproxy/plugin'
+ require 'siriproxy/plugin_manager'
+ end
+end
View
45 siri_proxy/connection.rb → lib/siriproxy/connection.rb
@@ -1,4 +1,5 @@
require 'cfpropertylist'
+require 'siriproxy/interpret_siri'
class SiriProxy::Connection < EventMachine::Connection
include EventMachine::Protocols::LineText2
@@ -29,13 +30,13 @@ def post_init
def ssl_handshake_completed
self.ssled = true
- puts "[Info - #{self.name}] SSL completed for #{self.name}" if LOG_LEVEL > 1
+ puts "[Info - #{self.name}] SSL completed for #{self.name}" if $LOG_LEVEL > 1
end
def receive_line(line) #Process header
- puts "[Header - #{self.name}] #{line}" if LOG_LEVEL > 2
+ puts "[Header - #{self.name}] #{line}" if $LOG_LEVEL > 2
if(line == "") #empty line indicates end of headers
- puts "[Debug - #{self.name}] Found end of headers" if LOG_LEVEL > 3
+ puts "[Debug - #{self.name}] Found end of headers" if $LOG_LEVEL > 3
set_binary_mode
self.processed_headers = true
end
@@ -63,22 +64,22 @@ def flush_output_buffer
return if output_buffer.empty?
if other_connection.ssled
- puts "[Debug - #{self.name}] Forwarding #{self.output_buffer.length} bytes of data to #{other_connection.name}" if LOG_LEVEL > 5
- #puts self.output_buffer.to_hex if LOG_LEVEL > 5
+ puts "[Debug - #{self.name}] Forwarding #{self.output_buffer.length} bytes of data to #{other_connection.name}" if $LOG_LEVEL > 5
+ #puts self.output_buffer.to_hex if $LOG_LEVEL > 5
other_connection.send_data(output_buffer)
self.output_buffer = ""
else
- puts "[Debug - #{self.name}] Buffering some data for later (#{self.output_buffer.length} bytes buffered)" if LOG_LEVEL > 5
- #puts self.output_buffer.to_hex if LOG_LEVEL > 5
+ puts "[Debug - #{self.name}] Buffering some data for later (#{self.output_buffer.length} bytes buffered)" if $LOG_LEVEL > 5
+ #puts self.output_buffer.to_hex if $LOG_LEVEL > 5
end
end
def process_compressed_data
self.unzipped_input << unzip_stream.inflate(self.input_buffer)
self.input_buffer = ""
- puts "========UNZIPPED DATA (from #{self.name} =========" if LOG_LEVEL > 5
- puts unzipped_input.to_hex if LOG_LEVEL > 5
- puts "==================================================" if LOG_LEVEL > 5
+ puts "========UNZIPPED DATA (from #{self.name} =========" if $LOG_LEVEL > 5
+ puts unzipped_input.to_hex if $LOG_LEVEL > 5
+ puts "==================================================" if $LOG_LEVEL > 5
while(self.has_next_object?)
object = read_next_object_from_unzipped()
@@ -108,7 +109,7 @@ def read_next_object_from_unzipped
self.unzipped_output << object
type = (info[1] == "3") ? "Ping" : "Pong"
- puts "[#{type} - #{self.name}] (#{info[2].to_i(16)})" if LOG_LEVEL > 3
+ puts "[#{type} - #{self.name}] (#{info[2].to_i(16)})" if $LOG_LEVEL > 3
self.unzipped_input = unzipped_input[5..-1]
flush_unzipped_output()
@@ -137,7 +138,7 @@ def inject_object_to_output_stream(object)
self.last_ref_id = object["refId"]
end
- puts "[Info - Forwarding object to #{self.other_connection.name}] #{object["class"]}" if LOG_LEVEL > 1
+ puts "[Info - Forwarding object to #{self.other_connection.name}] #{object["class"]}" if $LOG_LEVEL > 1
object_data = object.to_plist(:plist_format => CFPropertyList::List::FORMAT_BINARY)
@@ -162,21 +163,21 @@ def flush_unzipped_output
def prep_received_object(object)
if object["refId"] == self.last_ref_id && @block_rest_of_session
- puts "[Info - Dropping Object from Guzzoni] #{object["class"]}" if LOG_LEVEL > 1
- pp object if LOG_LEVEL > 3
+ puts "[Info - Dropping Object from Guzzoni] #{object["class"]}" if $LOG_LEVEL > 1
+ pp object if $LOG_LEVEL > 3
return nil
end
- puts "[Info - #{self.name}] Received Object: #{object["class"]}" if LOG_LEVEL == 1
- puts "[Info - #{self.name}] Received Object: #{object["class"]} (group: #{object["group"]})" if LOG_LEVEL == 2
- puts "[Info - #{self.name}] Received Object: #{object["class"]} (group: #{object["group"]}, ref_id: #{object["refId"]}, ace_id: #{object["aceId"]})" if LOG_LEVEL > 2
- pp object if LOG_LEVEL > 3
+ puts "[Info - #{self.name}] Received Object: #{object["class"]}" if $LOG_LEVEL == 1
+ puts "[Info - #{self.name}] Received Object: #{object["class"]} (group: #{object["group"]})" if $LOG_LEVEL == 2
+ puts "[Info - #{self.name}] Received Object: #{object["class"]} (group: #{object["group"]}, ref_id: #{object["refId"]}, ace_id: #{object["aceId"]})" if $LOG_LEVEL > 2
+ pp object if $LOG_LEVEL > 3
#keeping this for filters
object = received_object(object)
#block the rest of the session if a plugin claims ownership
- speech = Interpret.speech_recognized(object)
+ speech = SiriProxy::Interpret.speech_recognized(object)
if speech != nil
inject_object_to_output_stream(object)
block_rest_of_session if plugin_manager.process(speech)
@@ -184,8 +185,8 @@ def prep_received_object(object)
end
- #object = new_obj if ((new_obj = Interpret.unknown_intent(object, self, plugin_manager.method(:unknown_command))) != false)
- #object = new_obj if ((new_obj = Interpret.speech_recognized(object, self, plugin_manager.method(:speech_recognized))) != false)
+ #object = new_obj if ((new_obj = SiriProxy::Interpret.unknown_intent(object, self, plugin_manager.method(:unknown_command))) != false)
+ #object = new_obj if ((new_obj = SiriProxy::Interpret.speech_recognized(object, self, plugin_manager.method(:speech_recognized))) != false)
object
end
@@ -196,4 +197,4 @@ def received_object(object)
object
end
-end
+end
View
0  siri_proxy/connection/guzzoni.rb → lib/siriproxy/connection/guzzoni.rb
File renamed without changes
View
4 siri_proxy/connection/iphone.rb → lib/siriproxy/connection/iphone.rb
@@ -10,8 +10,8 @@ def initialize
def post_init
super
- start_tls(:cert_chain_file => "server.passless.crt",
- :private_key_file => "server.passless.key",
+ start_tls(:cert_chain_file => File.expand_path("~/.siriproxy/server.passless.crt"),
+ :private_key_file => File.expand_path("~/.siriproxy/server.passless.key"),
:verify_peer => false)
end
View
50 lib/siriproxy/interpret_siri.rb
@@ -0,0 +1,50 @@
+######
+# The idea behind this class is that you can call the different
+# methods to get different interpretations of a Siri object.
+# For instance, you can "unknown_intent" and it will check
+# to see if an object is a "Common#unknownIntent" response and
+# call the provided processor method with the appropriate info.
+# processor method signatures are provided in comments above each
+# method.
+#
+# each method will return "nil" if the object is not the valid
+# type. If it is, it will return the result of the processor.
+#####
+class SiriProxy::Interpret
+ class << self
+ #Checks if the object is Guzzoni responding that it can't
+ #determine the intent of the query
+ #processor(object, connection, unknown_text)
+ def unknown_intent(object, connection, processor)
+ return false if object == nil
+ return false if (!(object["properties"]["views"][0]["properties"]["dialogIdentifier"] == "Common#unknownIntent") rescue true)
+
+ searchUtterance = object["properties"]["views"][1]["properties"]["commands"][0]["properties"]["commands"][0]["properties"]["utterance"]
+ searchText = searchUtterance.split("^")[3]
+ return processor.call(object, connection, searchText)
+
+ return false
+ end
+
+ #Checks if the object is Guzzoni responding that it recognized
+ #speech. Sends "best interpretation" phrase to processor
+ #processor(object, connection, phrase)
+ def speech_recognized(object)
+ return nil if object == nil
+ return nil if (!(object["class"] == "SpeechRecognized") rescue true)
+ phrase = ""
+
+ object["properties"]["recognition"]["properties"]["phrases"].map { |phraseObj|
+ phraseObj["properties"]["interpretations"].first["properties"]["tokens"].map { |token|
+ tokenProps = token["properties"]
+
+ phrase = phrase[0..-2] if tokenProps["removeSpaceBefore"]
+ phrase << tokenProps["text"]
+ phrase << " " if !tokenProps["removeSpaceAfter"]
+ }
+ }
+
+ phrase
+ end
+ end
+end
View
0  siri_proxy/plugin.rb → lib/siriproxy/plugin.rb
File renamed without changes
View
8 siri_proxy/plugin_manager.rb → lib/siriproxy/plugin_manager.rb
@@ -10,8 +10,8 @@ def initialize()
def load_plugins()
@plugins = []
- if APP_CONFIG.plugins
- APP_CONFIG.plugins.each do |pluginConfig|
+ if $APP_CONFIG.plugins
+ $APP_CONFIG.plugins.each do |pluginConfig|
if pluginConfig.is_a? String
className = pluginConfig
requireName = "siriproxy-#{className.downcase}"
@@ -41,7 +41,7 @@ def send_request_complete_to_iphone
end
def respond(text, options={})
- self.guzzoni_conn.inject_object_to_output_stream(generate_siri_utterance(self.guzzoni_conn.last_ref_id, text, text, options[:prompt_for_response] == true))
+ self.guzzoni_conn.inject_object_to_output_stream(generate_siri_utterance(self.guzzoni_conn.last_ref_id, text, (options[:spoken] or text), options[:prompt_for_response] == true))
end
def no_matches
@@ -49,6 +49,6 @@ def no_matches
end
def log(text)
- puts "[Info - Plugin Manager] #{text}" if LOG_LEVEL >= 1
+ puts "[Info - Plugin Manager] #{text}" if $LOG_LEVEL >= 1
end
end
View
3  lib/siriproxy/version.rb
@@ -0,0 +1,3 @@
+class SiriProxy
+ VERSION = "0.0.1"
+end
View
5 plugins/siriproxy-example/lib/siriproxy-example.rb
@@ -19,6 +19,11 @@ def initialize(config)
request_completed #always complete your request! Otherwise the phone will "spin" at the user!
end
+
+ #Demonstrate that you can have Siri say one thing and write another"!
+ listen_for /you don't say/i do
+ say "Sometimes I don't write what I say", spoken: "Sometimes I don't say what I write"
+ end
#demonstrate state change
listen_for /siri proxy test state/i do
View
6 plugins/siriproxy-example/siriproxy-example.gemspec
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
s.rubyforge_project = "siriproxy-example"
- s.files = `git ls-files`.split("\n")
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.files = `git ls-files 2> /dev/null`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/* 2> /dev/null`.split("\n")
+ s.executables = `git ls-files -- bin/* 2> /dev/null`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
# specify any dependencies here; for example:
View
75 scripts/gen_certs.sh
@@ -0,0 +1,75 @@
+#!/usr/bin/env bash
+
+
+# Feel free to change any of these defaults
+countryName="US"
+stateOrProvinceName="Missouri"
+localityName=""
+organizationName="Siri Proxy"
+organizationalUnitName=""
+commonName="SiriProxyCA"
+emailAddress=""
+
+#You probably don't need to modify these unless you know what you're doing.
+SIRI_PROXY_ROOT=$1
+SIRI_PROXY_SETTINGS=~/.siriproxy
+LOG_FILE=$SIRI_PROXY_SETTINGS/cert.log
+TMP_DIR=/tmp
+TMP_CA_DIR=/tmp/siriCA #THIS ($dir) ALSO MUST BE MODIFIED IN openssl.cnf IF YOU CHANGE IT!
+
+## Do not edit below here!
+
+echo "" > $LOG_FILE
+
+echo "Creating CA directory"
+mkdir -p $TMP_CA_DIR/{certs,crl,newcerts,private}
+touch $TMP_CA_DIR/index.txt
+echo 01 > $TMP_CA_DIR/crtnumber
+
+echo "Generating '${commonName}' CA request"
+echo "${countryName}" > $TMP_DIR/ca.args
+echo "${stateOrProvinceName}" >> $TMP_DIR/ca.args
+echo "${localityName}" >> $TMP_DIR/ca.args
+echo "${organizationName}" >> $TMP_DIR/ca.args
+echo "${organizationalUnitName}" >> $TMP_DIR/ca.args
+echo "${commonName}" >> $TMP_DIR/ca.args
+echo "${emailAddress}" >> $TMP_DIR/ca.args
+echo "" >> $TMP_DIR/ca.args
+echo "" >> $TMP_DIR/ca.args
+
+cat $TMP_DIR/ca.args | openssl req -new -config $SIRI_PROXY_ROOT/scripts/openssl.cnf -keyout $TMP_CA_DIR/private/cakey.pem -out $TMP_CA_DIR/careq.pem -passin pass:1234 -passout pass:1234 >> $LOG_FILE 2>> $LOG_FILE
+
+echo "Self-signing '${commonName}' CA"
+openssl ca -create_serial -passin pass:1234 -config $SIRI_PROXY_ROOT/scripts/openssl.cnf -out $TMP_CA_DIR/cacert.pem -outdir $TMP_CA_DIR/newcerts -days 1095 -batch -keyfile $TMP_CA_DIR/private/cakey.pem -selfsign -extensions v3_ca -infiles $TMP_CA_DIR/careq.pem >> $LOG_FILE 2>> $LOG_FILE
+
+echo "Generating guzzoni.apple.com certificate request"
+echo "Generating '${commonName}' CA request"
+echo "${countryName}" > $TMP_DIR/ca.args
+echo "${stateOrProvinceName}" >> $TMP_DIR/ca.args
+echo "${localityName}" >> $TMP_DIR/ca.args
+echo "${organizationName}" >> $TMP_DIR/ca.args
+echo "${organizationalUnitName}" >> $TMP_DIR/ca.args
+echo "guzzoni.apple.com" >> $TMP_DIR/ca.args
+echo "${emailAddress}" >> $TMP_DIR/ca.args
+echo "" >> $TMP_DIR/ca.args
+echo "" >> $TMP_DIR/ca.args
+cat $TMP_DIR/ca.args | openssl req -new -keyout $TMP_DIR/newkey.pem -config $SIRI_PROXY_ROOT/scripts/openssl.cnf -out $TMP_DIR/newreq.pem -days 1095 -passin pass:1234 -passout pass:1234 >> $LOG_FILE 2>> $LOG_FILE
+
+echo "Generating guzzoni.apple.com certificate"
+yes | openssl ca -policy policy_anything -out $TMP_DIR/newcert.pem -config $SIRI_PROXY_ROOT/scripts/openssl.cnf -passin pass:1234 -keyfile $TMP_CA_DIR/private/cakey.pem -cert $TMP_CA_DIR/cacert.pem -infiles $TMP_DIR/newreq.pem >> $LOG_FILE 2>> $LOG_FILE
+
+echo "Removing passphrase from guzzoni.apple.com key"
+yes | openssl rsa -in $TMP_DIR/newkey.pem -out $SIRI_PROXY_SETTINGS/server.passless.key -passin pass:1234 >> $LOG_FILE 2>> $LOG_FILE
+
+echo "Cleaning up..."
+mv $TMP_DIR/newcert.pem $SIRI_PROXY_SETTINGS/server.passless.crt
+mv $TMP_CA_DIR/cacert.pem $SIRI_PROXY_SETTINGS/ca.pem
+rm -rf $TMP_DIR/new{key,req}.pem $TMP_CA_DIR $TMP_DIR/ca.args
+
+echo "Done! (For details on any errors, check '${LOG_FILE}')"
+echo "-------------------------------------------------------------"
+echo ""
+echo "Please install ${SIRI_PROXY_SETTINGS}/ca.pem onto your phone!"
+echo "(Note: You can do this by emailing the file to yourself)"
+echo ""
+echo "-------------------------------------------------------------"
View
350 scripts/openssl.cnf
@@ -0,0 +1,350 @@
+#
+# OpenSSL example configuration file.
+# This is mostly being used for generation of certificate requests.
+#
+
+# This definition stops the following lines choking if HOME isn't
+# defined.
+HOME = .
+RANDFILE = $ENV::HOME/.rnd
+
+# Extra OBJECT IDENTIFIER info:
+#oid_file = $ENV::HOME/.oid
+oid_section = new_oids
+
+# To use this configuration file with the "-extfile" option of the
+# "openssl x509" utility, name here the section containing the
+# X.509v3 extensions to use:
+# extensions =
+# (Alternatively, use a configuration file that has only
+# X.509v3 extensions in its main [= default] section.)
+
+[ new_oids ]
+
+# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
+# Add a simple OID like this:
+# testoid1=1.2.3.4
+# Or use config file substitution like this:
+# testoid2=${testoid1}.5.6
+
+# Policies used by the TSA examples.
+tsa_policy1 = 1.2.3.4.1
+tsa_policy2 = 1.2.3.4.5.6
+tsa_policy3 = 1.2.3.4.5.7
+
+####################################################################
+[ ca ]
+default_ca = CA_default # The default ca section
+
+####################################################################
+[ CA_default ]
+
+dir = /tmp/siriCA # Where everything is kept
+certs = $dir/certs # Where the issued certs are kept
+crl_dir = $dir/crl # Where the issued crl are kept
+database = $dir/index.txt # database index file.
+#unique_subject = no # Set to 'no' to allow creation of
+ # several ctificates with same subject.
+new_certs_dir = $dir/newcerts # default place for new certs.
+
+certificate = $dir/cacert.pem # The CA certificate
+serial = $dir/serial # The current serial number
+crlnumber = $dir/crlnumber # the current crl number
+ # must be commented out to leave a V1 CRL
+crl = $dir/crl.pem # The current CRL
+private_key = $dir/private/cakey.pem# The private key
+RANDFILE = $dir/private/.rand # private random number file
+
+x509_extensions = usr_cert # The extentions to add to the cert
+
+# Comment out the following two lines for the "traditional"
+# (and highly broken) format.
+name_opt = ca_default # Subject Name options
+cert_opt = ca_default # Certificate field options
+
+# Extension copying option: use with caution.
+# copy_extensions = copy
+
+# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
+# so this is commented out by default to leave a V1 CRL.
+# crlnumber must also be commented out to leave a V1 CRL.
+# crl_extensions = crl_ext
+
+default_days = 365 # how long to certify for
+default_crl_days= 30 # how long before next CRL
+default_md = default # use public key default MD
+preserve = no # keep passed DN ordering
+
+# A few difference way of specifying how similar the request should look
+# For type CA, the listed attributes must be the same, and the optional
+# and supplied fields are just that :-)
+policy = policy_match
+
+# For the CA policy
+[ policy_match ]
+countryName = match
+stateOrProvinceName = match
+organizationName = match
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+# For the 'anything' policy
+# At this point in time, you must list all acceptable 'object'
+# types.
+[ policy_anything ]
+countryName = optional
+stateOrProvinceName = optional
+localityName = optional
+organizationName = optional
+organizationalUnitName = optional
+commonName = supplied
+emailAddress = optional
+
+####################################################################
+[ req ]
+default_bits = 1024
+default_keyfile = privkey.pem
+distinguished_name = req_distinguished_name
+attributes = req_attributes
+x509_extensions = v3_ca # The extentions to add to the self signed cert
+
+# Passwords for private keys if not present they will be prompted for
+# input_password = secret
+# output_password = secret
+
+# This sets a mask for permitted string types. There are several options.
+# default: PrintableString, T61String, BMPString.
+# pkix : PrintableString, BMPString (PKIX recommendation before 2004)
+# utf8only: only UTF8Strings (PKIX recommendation after 2004).
+# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
+# MASK:XXXX a literal mask value.
+# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
+string_mask = utf8only
+
+# req_extensions = v3_req # The extensions to add to a certificate request
+
+[ req_distinguished_name ]
+countryName = Country Name (2 letter code)
+countryName_default = AU
+countryName_min = 2
+countryName_max = 2
+
+stateOrProvinceName = State or Province Name (full name)
+stateOrProvinceName_default = Some-State
+
+localityName = Locality Name (eg, city)
+
+0.organizationName = Organization Name (eg, company)
+0.organizationName_default = Internet Widgits Pty Ltd
+
+# we can do this but it is not needed normally :-)
+#1.organizationName = Second Organization Name (eg, company)
+#1.organizationName_default = World Wide Web Pty Ltd
+
+organizationalUnitName = Organizational Unit Name (eg, section)
+#organizationalUnitName_default =
+
+commonName = Common Name (eg, YOUR name)
+commonName_max = 64
+
+emailAddress = Email Address
+emailAddress_max = 64
+
+# SET-ex3 = SET extension number 3
+
+[ req_attributes ]
+challengePassword = A challenge password
+challengePassword_min = 4
+challengePassword_max = 20
+
+unstructuredName = An optional company name
+
+[ usr_cert ]
+
+# These extensions are added when 'ca' signs a request.
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This is required for TSA certificates.
+# extendedKeyUsage = critical,timeStamping
+
+[ v3_req ]
+
+# Extensions to add to a certificate request
+
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+[ v3_ca ]
+
+
+# Extensions for a typical CA
+
+
+# PKIX recommendation.
+
+subjectKeyIdentifier=hash
+
+authorityKeyIdentifier=keyid:always,issuer
+
+# This is what PKIX recommends but some broken software chokes on critical
+# extensions.
+#basicConstraints = critical,CA:true
+# So we do this instead.
+basicConstraints = CA:true
+
+# Key usage: this is typical for a CA certificate. However since it will
+# prevent it being used as an test self-signed certificate it is best
+# left out by default.
+# keyUsage = cRLSign, keyCertSign
+
+# Some might want this also
+# nsCertType = sslCA, emailCA
+
+# Include email address in subject alt name: another PKIX recommendation
+# subjectAltName=email:copy
+# Copy issuer details
+# issuerAltName=issuer:copy
+
+# DER hex encoding of an extension: beware experts only!
+# obj=DER:02:03
+# Where 'obj' is a standard or added object
+# You can even override a supported extension:
+# basicConstraints= critical, DER:30:03:01:01:FF
+
+[ crl_ext ]
+
+# CRL extensions.
+# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
+
+# issuerAltName=issuer:copy
+authorityKeyIdentifier=keyid:always
+
+[ proxy_cert_ext ]
+# These extensions should be added when creating a proxy certificate
+
+# This goes against PKIX guidelines but some CAs do it and some software
+# requires this to avoid interpreting an end user certificate as a CA.
+
+basicConstraints=CA:FALSE
+
+# Here are some examples of the usage of nsCertType. If it is omitted
+# the certificate can be used for anything *except* object signing.
+
+# This is OK for an SSL server.
+# nsCertType = server
+
+# For an object signing certificate this would be used.
+# nsCertType = objsign
+
+# For normal client use this is typical
+# nsCertType = client, email
+
+# and for everything including object signing:
+# nsCertType = client, email, objsign
+
+# This is typical in keyUsage for a client certificate.
+# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+# This will be displayed in Netscape's comment listbox.
+nsComment = "OpenSSL Generated Certificate"
+
+# PKIX recommendations harmless if included in all certificates.
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid,issuer
+
+# This stuff is for subjectAltName and issuerAltname.
+# Import the email address.
+# subjectAltName=email:copy
+# An alternative to produce certificates that aren't
+# deprecated according to PKIX.
+# subjectAltName=email:move
+
+# Copy subject details
+# issuerAltName=issuer:copy
+
+#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
+#nsBaseUrl
+#nsRevocationUrl
+#nsRenewalUrl
+#nsCaPolicyUrl
+#nsSslServerName
+
+# This really needs to be in place for it to be a proxy certificate.
+proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
+
+####################################################################
+[ tsa ]
+
+default_tsa = tsa_config1 # the default TSA section
+
+[ tsa_config1 ]
+
+# These are used by the TSA reply generation only.
+dir = ./demoCA # TSA root directory
+serial = $dir/tsaserial # The current serial number (mandatory)
+crypto_device = builtin # OpenSSL engine to use for signing
+signer_cert = $dir/tsacert.pem # The TSA signing certificate
+ # (optional)
+certs = $dir/cacert.pem # Certificate chain to include in reply
+ # (optional)
+signer_key = $dir/private/tsakey.pem # The TSA private key (optional)
+
+default_policy = tsa_policy1 # Policy if request did not specify it
+ # (optional)
+other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional)
+digests = md5, sha1 # Acceptable message digests (mandatory)
+accuracy = secs:1, millisecs:500, microsecs:100 # (optional)
+clock_precision_digits = 0 # number of digits after dot. (optional)
+ordering = yes # Is ordering defined for timestamps?
+ # (optional, default: no)
+tsa_name = yes # Must the TSA name be included in the reply?
+ # (optional, default: no)
+ess_cert_id_chain = no # Must the ESS cert id chain be included?
+ # (optional, default: no)
View
27 siriproxy.gemspec
@@ -0,0 +1,27 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "siriproxy/version"
+
+Gem::Specification.new do |s|
+ s.name = "siriproxy"
+ s.version = SiriProxy::VERSION
+ s.authors = ["plamoni", "chendo", "netpro2k"]
+ s.email = []
+ s.homepage = ""
+ s.summary = %q{A (tampering) proxy server for Apple's Siri}
+ s.description = %q{Siri Proxy is a proxy server for Apple's Siri "assistant." The idea is to allow for the creation of custom handlers for different actions. This can allow developers to easily add functionality to Siri.}
+
+ s.rubyforge_project = "siriproxy"
+
+ s.files = `git ls-files 2> /dev/null`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/* 2> /dev/null`.split("\n")
+ s.executables = `git ls-files -- bin/* 2> /dev/null`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
+
+ s.add_runtime_dependency "CFPropertyList"
+ s.add_runtime_dependency "eventmachine"
+ s.add_runtime_dependency "uuidtools"
+ s.add_development_dependency "rake"
+end
View
24 start.rb
@@ -1,24 +0,0 @@
-#!/usr/bin/env ruby
-$LOAD_PATH << File.dirname(__FILE__)
-$KCODE='u' #setting KCODE to unicode for Ruby 1.8
-
-require 'rubygems'
-require 'bundler'
-require 'bundler/setup'
-
-require 'yaml'
-require 'ostruct'
-
-require 'siri_proxy'
-require 'siri_proxy/connection'
-require 'siri_proxy/connection/iphone'
-require 'siri_proxy/connection/guzzoni'
-
-require 'siri_proxy/plugin'
-require 'siri_proxy/plugin_manager'
-
-APP_CONFIG = OpenStruct.new(YAML.load_file('config.yml'))
-LOG_LEVEL = APP_CONFIG.log_level.to_i
-proxy = SiriProxy.new()
-
-#that's it. :-)
Please sign in to comment.
Something went wrong with that request. Please try again.