siriproxy 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +11 -0
- data/.rvmrc +1 -0
- data/COPYING +674 -0
- data/Gemfile +25 -0
- data/README.md +262 -0
- data/Rakefile +9 -0
- data/bin/siriproxy +6 -0
- data/config.example.yml +30 -0
- data/lib/siri_objects.rb +331 -0
- data/lib/siriproxy/command_line.rb +201 -0
- data/lib/siriproxy/connection/guzzoni.rb +24 -0
- data/lib/siriproxy/connection/iphone.rb +50 -0
- data/lib/siriproxy/connection.rb +212 -0
- data/lib/siriproxy/interpret_siri.rb +50 -0
- data/lib/siriproxy/plugin.rb +58 -0
- data/lib/siriproxy/plugin_manager.rb +78 -0
- data/lib/siriproxy/version.rb +3 -0
- data/lib/siriproxy.rb +37 -0
- data/plugins/siriproxy-example/.gitignore +4 -0
- data/plugins/siriproxy-example/Gemfile +4 -0
- data/plugins/siriproxy-example/Rakefile +1 -0
- data/plugins/siriproxy-example/lib/siriproxy-example.rb +95 -0
- data/plugins/siriproxy-example/siriproxy-example.gemspec +23 -0
- data/scripts/gen_certs.sh +80 -0
- data/scripts/openssl.cnf +353 -0
- data/siriproxy.gemspec +27 -0
- metadata +147 -0
data/lib/siriproxy.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'eventmachine'
|
2
|
+
require 'zlib'
|
3
|
+
require 'pp'
|
4
|
+
|
5
|
+
class String
|
6
|
+
def to_hex(seperator=" ")
|
7
|
+
bytes.to_a.map{|i| i.to_s(16).rjust(2, '0')}.join(seperator)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class SiriProxy
|
12
|
+
|
13
|
+
def initialize()
|
14
|
+
# @todo shouldnt need this, make centralize logging instead
|
15
|
+
$LOG_LEVEL = $APP_CONFIG.log_level.to_i
|
16
|
+
EventMachine.run do
|
17
|
+
begin
|
18
|
+
listen_addr = $APP_CONFIG.listen || "0.0.0.0"
|
19
|
+
puts "Starting SiriProxy on #{listen_addr}:#{$APP_CONFIG.port}.."
|
20
|
+
EventMachine::start_server(listen_addr, $APP_CONFIG.port, SiriProxy::Connection::Iphone, $APP_CONFIG.upstream_dns) { |conn|
|
21
|
+
puts "[Info - Guzzoni] Starting conneciton #{conn.inspect}" if $LOG_LEVEL < 1
|
22
|
+
conn.plugin_manager = SiriProxy::PluginManager.new()
|
23
|
+
conn.plugin_manager.iphone_conn = conn
|
24
|
+
}
|
25
|
+
puts "SiriProxy up and running."
|
26
|
+
rescue RuntimeError => err
|
27
|
+
if err.message == "no acceptor"
|
28
|
+
raise "Cannot start the server on port #{$APP_CONFIG.port} - are you root, or have another process on this port already?"
|
29
|
+
else
|
30
|
+
raise
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
EventMachine.set_effective_user($APP_CONFIG.user) if $APP_CONFIG.user
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'cora'
|
2
|
+
require 'siri_objects'
|
3
|
+
require 'pp'
|
4
|
+
|
5
|
+
#######
|
6
|
+
# This is a "hello world" style plugin. It simply intercepts the phrase "test siri proxy" and responds
|
7
|
+
# with a message about the proxy being up and running (along with a couple other core features). This
|
8
|
+
# is good base code for other plugins.
|
9
|
+
#
|
10
|
+
# Remember to add other plugins to the "config.yml" file if you create them!
|
11
|
+
######
|
12
|
+
|
13
|
+
class SiriProxy::Plugin::Example < SiriProxy::Plugin
|
14
|
+
def initialize(config)
|
15
|
+
#if you have custom configuration options, process them here!
|
16
|
+
end
|
17
|
+
|
18
|
+
#get the user's location and display it in the logs
|
19
|
+
#filters are still in their early stages. Their interface may be modified
|
20
|
+
filter "SetRequestOrigin", direction: :from_iphone do |object|
|
21
|
+
puts "[Info - User Location] lat: #{object["properties"]["latitude"]}, long: #{object["properties"]["longitude"]}"
|
22
|
+
|
23
|
+
#Note about returns from filters:
|
24
|
+
# - Return false to stop the object from being forwarded
|
25
|
+
# - Return a Hash to substitute or update the object
|
26
|
+
# - Return nil (or anything not a Hash or false) to have the object forwarded (along with any
|
27
|
+
# modifications made to it)
|
28
|
+
end
|
29
|
+
|
30
|
+
listen_for /where am i/i do
|
31
|
+
say "Your location is: #{location.address}"
|
32
|
+
end
|
33
|
+
|
34
|
+
listen_for /test siri proxy/i do
|
35
|
+
say "Siri Proxy is up and running!" #say something to the user!
|
36
|
+
|
37
|
+
request_completed #always complete your request! Otherwise the phone will "spin" at the user!
|
38
|
+
end
|
39
|
+
|
40
|
+
#Demonstrate that you can have Siri say one thing and write another"!
|
41
|
+
listen_for /you don't say/i do
|
42
|
+
say "Sometimes I don't write what I say", spoken: "Sometimes I don't say what I write"
|
43
|
+
end
|
44
|
+
|
45
|
+
#demonstrate state change
|
46
|
+
listen_for /siri proxy test state/i do
|
47
|
+
set_state :some_state #set a state... this is useful when you want to change how you respond after certain conditions are met!
|
48
|
+
say "I set the state, try saying 'confirm state change'"
|
49
|
+
|
50
|
+
request_completed #always complete your request! Otherwise the phone will "spin" at the user!
|
51
|
+
end
|
52
|
+
|
53
|
+
listen_for /confirm state change/i, within_state: :some_state do #this only gets processed if you're within the :some_state state!
|
54
|
+
say "State change works fine!"
|
55
|
+
set_state nil #clear out the state!
|
56
|
+
|
57
|
+
request_completed #always complete your request! Otherwise the phone will "spin" at the user!
|
58
|
+
end
|
59
|
+
|
60
|
+
#demonstrate asking a question
|
61
|
+
listen_for /siri proxy test question/i do
|
62
|
+
response = ask "Is this thing working?" #ask the user for something
|
63
|
+
|
64
|
+
if(response =~ /yes/i) #process their response
|
65
|
+
say "Great!"
|
66
|
+
else
|
67
|
+
say "You could have just said 'yes'!"
|
68
|
+
end
|
69
|
+
|
70
|
+
request_completed #always complete your request! Otherwise the phone will "spin" at the user!
|
71
|
+
end
|
72
|
+
|
73
|
+
#demonstrate capturing data from the user (e.x. "Siri proxy number 15")
|
74
|
+
listen_for /siri proxy number ([0-9,]*[0-9])/i do |number|
|
75
|
+
say "Detected number: #{number}"
|
76
|
+
|
77
|
+
request_completed #always complete your request! Otherwise the phone will "spin" at the user!
|
78
|
+
end
|
79
|
+
|
80
|
+
#demonstrate injection of more complex objects without shortcut methods.
|
81
|
+
listen_for /test map/i do
|
82
|
+
add_views = SiriAddViews.new
|
83
|
+
add_views.make_root(last_ref_id)
|
84
|
+
map_snippet = SiriMapItemSnippet.new
|
85
|
+
map_snippet.items << SiriMapItem.new
|
86
|
+
utterance = SiriAssistantUtteranceView.new("Testing map injection!")
|
87
|
+
add_views.views << utterance
|
88
|
+
add_views.views << map_snippet
|
89
|
+
|
90
|
+
#you can also do "send_object object, target: :guzzoni" in order to send an object to guzzoni
|
91
|
+
send_object add_views #send_object takes a hash or a SiriObject object
|
92
|
+
|
93
|
+
request_completed #always complete your request! Otherwise the phone will "spin" at the user!
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "siriproxy-example"
|
6
|
+
s.version = "0.0.1"
|
7
|
+
s.authors = ["plamoni"]
|
8
|
+
s.email = [""]
|
9
|
+
s.homepage = ""
|
10
|
+
s.summary = %q{An Example Siri Proxy Plugin}
|
11
|
+
s.description = %q{This is a "hello world" style plugin. It simply intercepts the phrase "text siri proxy" and responds with a message about the proxy being up and running. This is good base code for other plugins. }
|
12
|
+
|
13
|
+
s.rubyforge_project = "siriproxy-example"
|
14
|
+
|
15
|
+
s.files = `git ls-files 2> /dev/null`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/* 2> /dev/null`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/* 2> /dev/null`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
|
20
|
+
# specify any dependencies here; for example:
|
21
|
+
# s.add_development_dependency "rspec"
|
22
|
+
# s.add_runtime_dependency "rest-client"
|
23
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
commonName=$2
|
4
|
+
|
5
|
+
if [ "${commonName}" == "" ]
|
6
|
+
then
|
7
|
+
commonName="SiriProxyCA"
|
8
|
+
fi
|
9
|
+
|
10
|
+
# Feel free to change any of these defaults
|
11
|
+
countryName="US"
|
12
|
+
stateOrProvinceName="Missouri"
|
13
|
+
localityName=""
|
14
|
+
organizationName="Siri Proxy"
|
15
|
+
organizationalUnitName=""
|
16
|
+
emailAddress=""
|
17
|
+
|
18
|
+
#You probably don't need to modify these unless you know what you're doing.
|
19
|
+
SIRI_PROXY_ROOT=$1
|
20
|
+
SIRI_PROXY_SETTINGS=~/.siriproxy
|
21
|
+
LOG_FILE=$SIRI_PROXY_SETTINGS/cert.log
|
22
|
+
TMP_DIR=/tmp
|
23
|
+
TMP_CA_DIR=/tmp/siriCA #THIS ($dir) ALSO MUST BE MODIFIED IN openssl.cnf IF YOU CHANGE IT!
|
24
|
+
|
25
|
+
## Do not edit below here!
|
26
|
+
|
27
|
+
echo "" > $LOG_FILE
|
28
|
+
|
29
|
+
echo "Creating CA directory"
|
30
|
+
mkdir -p $TMP_CA_DIR/{certs,crl,newcerts,private}
|
31
|
+
touch $TMP_CA_DIR/index.txt
|
32
|
+
echo 01 > $TMP_CA_DIR/crtnumber
|
33
|
+
|
34
|
+
echo "Generating '${commonName}' CA request"
|
35
|
+
echo "${countryName}" > $TMP_DIR/ca.args
|
36
|
+
echo "${stateOrProvinceName}" >> $TMP_DIR/ca.args
|
37
|
+
echo "${localityName}" >> $TMP_DIR/ca.args
|
38
|
+
echo "${organizationName}" >> $TMP_DIR/ca.args
|
39
|
+
echo "${organizationalUnitName}" >> $TMP_DIR/ca.args
|
40
|
+
echo "${commonName}" >> $TMP_DIR/ca.args
|
41
|
+
echo "${emailAddress}" >> $TMP_DIR/ca.args
|
42
|
+
echo "" >> $TMP_DIR/ca.args
|
43
|
+
echo "" >> $TMP_DIR/ca.args
|
44
|
+
|
45
|
+
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
|
46
|
+
|
47
|
+
echo "Self-signing '${commonName}' CA"
|
48
|
+
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
|
49
|
+
|
50
|
+
echo "Generating guzzoni.apple.com certificate request"
|
51
|
+
echo "Generating '${commonName}' CA request"
|
52
|
+
echo "${countryName}" > $TMP_DIR/ca.args
|
53
|
+
echo "${stateOrProvinceName}" >> $TMP_DIR/ca.args
|
54
|
+
echo "${localityName}" >> $TMP_DIR/ca.args
|
55
|
+
echo "${organizationName}" >> $TMP_DIR/ca.args
|
56
|
+
echo "${organizationalUnitName}" >> $TMP_DIR/ca.args
|
57
|
+
echo "guzzoni.apple.com" >> $TMP_DIR/ca.args
|
58
|
+
echo "${emailAddress}" >> $TMP_DIR/ca.args
|
59
|
+
echo "" >> $TMP_DIR/ca.args
|
60
|
+
echo "" >> $TMP_DIR/ca.args
|
61
|
+
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
|
62
|
+
|
63
|
+
echo "Generating guzzoni.apple.com certificate"
|
64
|
+
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
|
65
|
+
|
66
|
+
echo "Removing passphrase from guzzoni.apple.com key"
|
67
|
+
yes | openssl rsa -in $TMP_DIR/newkey.pem -out $SIRI_PROXY_SETTINGS/server.passless.key -passin pass:1234 >> $LOG_FILE 2>> $LOG_FILE
|
68
|
+
|
69
|
+
echo "Cleaning up..."
|
70
|
+
mv $TMP_DIR/newcert.pem $SIRI_PROXY_SETTINGS/server.passless.crt
|
71
|
+
mv $TMP_CA_DIR/cacert.pem $SIRI_PROXY_SETTINGS/ca.pem
|
72
|
+
rm -rf $TMP_DIR/new{key,req}.pem $TMP_CA_DIR $TMP_DIR/ca.args
|
73
|
+
|
74
|
+
echo "Done! (For details on any errors, check '${LOG_FILE}')"
|
75
|
+
echo "-------------------------------------------------------------"
|
76
|
+
echo ""
|
77
|
+
echo "Please install ${SIRI_PROXY_SETTINGS}/ca.pem onto your phone!"
|
78
|
+
echo "(Note: You can do this by emailing the file to yourself)"
|
79
|
+
echo ""
|
80
|
+
echo "-------------------------------------------------------------"
|
data/scripts/openssl.cnf
ADDED
@@ -0,0 +1,353 @@
|
|
1
|
+
#
|
2
|
+
# OpenSSL example configuration file.
|
3
|
+
# This is mostly being used for generation of certificate requests.
|
4
|
+
#
|
5
|
+
|
6
|
+
# This definition stops the following lines choking if HOME isn't
|
7
|
+
# defined.
|
8
|
+
HOME = .
|
9
|
+
RANDFILE = $ENV::HOME/.rnd
|
10
|
+
|
11
|
+
# Extra OBJECT IDENTIFIER info:
|
12
|
+
#oid_file = $ENV::HOME/.oid
|
13
|
+
oid_section = new_oids
|
14
|
+
|
15
|
+
# To use this configuration file with the "-extfile" option of the
|
16
|
+
# "openssl x509" utility, name here the section containing the
|
17
|
+
# X.509v3 extensions to use:
|
18
|
+
# extensions =
|
19
|
+
# (Alternatively, use a configuration file that has only
|
20
|
+
# X.509v3 extensions in its main [= default] section.)
|
21
|
+
|
22
|
+
[ new_oids ]
|
23
|
+
|
24
|
+
# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
|
25
|
+
# Add a simple OID like this:
|
26
|
+
# testoid1=1.2.3.4
|
27
|
+
# Or use config file substitution like this:
|
28
|
+
# testoid2=${testoid1}.5.6
|
29
|
+
|
30
|
+
# Policies used by the TSA examples.
|
31
|
+
tsa_policy1 = 1.2.3.4.1
|
32
|
+
tsa_policy2 = 1.2.3.4.5.6
|
33
|
+
tsa_policy3 = 1.2.3.4.5.7
|
34
|
+
|
35
|
+
####################################################################
|
36
|
+
[ ca ]
|
37
|
+
default_ca = CA_default # The default ca section
|
38
|
+
|
39
|
+
|
40
|
+
####################################################################
|
41
|
+
[ CA_default ]
|
42
|
+
|
43
|
+
dir = /tmp/siriCA # Where everything is kept
|
44
|
+
certs = $dir/certs # Where the issued certs are kept
|
45
|
+
crl_dir = $dir/crl # Where the issued crl are kept
|
46
|
+
database = $dir/index.txt # database index file.
|
47
|
+
#unique_subject = no # Set to 'no' to allow creation of
|
48
|
+
# several ctificates with same subject.
|
49
|
+
new_certs_dir = $dir/newcerts # default place for new certs.
|
50
|
+
|
51
|
+
certificate = $dir/cacert.pem # The CA certificate
|
52
|
+
serial = $dir/serial # The current serial number
|
53
|
+
crlnumber = $dir/crlnumber # the current crl number
|
54
|
+
# must be commented out to leave a V1 CRL
|
55
|
+
crl = $dir/crl.pem # The current CRL
|
56
|
+
private_key = $dir/private/cakey.pem# The private key
|
57
|
+
RANDFILE = $dir/private/.rand # private random number file
|
58
|
+
|
59
|
+
x509_extensions = usr_cert # The extentions to add to the cert
|
60
|
+
|
61
|
+
# Comment out the following two lines for the "traditional"
|
62
|
+
# (and highly broken) format.
|
63
|
+
name_opt = ca_default # Subject Name options
|
64
|
+
cert_opt = ca_default # Certificate field options
|
65
|
+
|
66
|
+
# Extension copying option: use with caution.
|
67
|
+
# copy_extensions = copy
|
68
|
+
|
69
|
+
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
|
70
|
+
# so this is commented out by default to leave a V1 CRL.
|
71
|
+
# crlnumber must also be commented out to leave a V1 CRL.
|
72
|
+
# crl_extensions = crl_ext
|
73
|
+
|
74
|
+
default_days = 365 # how long to certify for
|
75
|
+
default_crl_days= 30 # how long before next CRL
|
76
|
+
default_md = sha1 # use public key default MD
|
77
|
+
preserve = no # keep passed DN ordering
|
78
|
+
|
79
|
+
# A few difference way of specifying how similar the request should look
|
80
|
+
# For type CA, the listed attributes must be the same, and the optional
|
81
|
+
# and supplied fields are just that :-)
|
82
|
+
policy = policy_match
|
83
|
+
|
84
|
+
# For the CA policy
|
85
|
+
[ policy_match ]
|
86
|
+
countryName = match
|
87
|
+
stateOrProvinceName = match
|
88
|
+
organizationName = match
|
89
|
+
organizationalUnitName = optional
|
90
|
+
commonName = supplied
|
91
|
+
emailAddress = optional
|
92
|
+
|
93
|
+
# For the 'anything' policy
|
94
|
+
# At this point in time, you must list all acceptable 'object'
|
95
|
+
# types.
|
96
|
+
[ policy_anything ]
|
97
|
+
countryName = optional
|
98
|
+
stateOrProvinceName = optional
|
99
|
+
localityName = optional
|
100
|
+
organizationName = optional
|
101
|
+
organizationalUnitName = optional
|
102
|
+
commonName = supplied
|
103
|
+
emailAddress = optional
|
104
|
+
|
105
|
+
####################################################################
|
106
|
+
[ req ]
|
107
|
+
default_bits = 1024
|
108
|
+
default_keyfile = privkey.pem
|
109
|
+
distinguished_name = req_distinguished_name
|
110
|
+
attributes = req_attributes
|
111
|
+
x509_extensions = v3_ca # The extentions to add to the self signed cert
|
112
|
+
default_md = sha1
|
113
|
+
|
114
|
+
|
115
|
+
# Passwords for private keys if not present they will be prompted for
|
116
|
+
# input_password = secret
|
117
|
+
# output_password = secret
|
118
|
+
|
119
|
+
# This sets a mask for permitted string types. There are several options.
|
120
|
+
# default: PrintableString, T61String, BMPString.
|
121
|
+
# pkix : PrintableString, BMPString (PKIX recommendation before 2004)
|
122
|
+
# utf8only: only UTF8Strings (PKIX recommendation after 2004).
|
123
|
+
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
|
124
|
+
# MASK:XXXX a literal mask value.
|
125
|
+
# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
|
126
|
+
string_mask = utf8only
|
127
|
+
|
128
|
+
# req_extensions = v3_req # The extensions to add to a certificate request
|
129
|
+
|
130
|
+
[ req_distinguished_name ]
|
131
|
+
countryName = Country Name (2 letter code)
|
132
|
+
countryName_default = AU
|
133
|
+
countryName_min = 2
|
134
|
+
countryName_max = 2
|
135
|
+
|
136
|
+
stateOrProvinceName = State or Province Name (full name)
|
137
|
+
stateOrProvinceName_default = Some-State
|
138
|
+
|
139
|
+
localityName = Locality Name (eg, city)
|
140
|
+
|
141
|
+
0.organizationName = Organization Name (eg, company)
|
142
|
+
0.organizationName_default = Internet Widgits Pty Ltd
|
143
|
+
|
144
|
+
# we can do this but it is not needed normally :-)
|
145
|
+
#1.organizationName = Second Organization Name (eg, company)
|
146
|
+
#1.organizationName_default = World Wide Web Pty Ltd
|
147
|
+
|
148
|
+
organizationalUnitName = Organizational Unit Name (eg, section)
|
149
|
+
#organizationalUnitName_default =
|
150
|
+
|
151
|
+
commonName = Common Name (eg, YOUR name)
|
152
|
+
commonName_max = 64
|
153
|
+
|
154
|
+
emailAddress = Email Address
|
155
|
+
emailAddress_max = 64
|
156
|
+
|
157
|
+
# SET-ex3 = SET extension number 3
|
158
|
+
|
159
|
+
[ req_attributes ]
|
160
|
+
challengePassword = A challenge password
|
161
|
+
challengePassword_min = 4
|
162
|
+
challengePassword_max = 20
|
163
|
+
|
164
|
+
unstructuredName = An optional company name
|
165
|
+
|
166
|
+
[ usr_cert ]
|
167
|
+
|
168
|
+
# These extensions are added when 'ca' signs a request.
|
169
|
+
|
170
|
+
# This goes against PKIX guidelines but some CAs do it and some software
|
171
|
+
# requires this to avoid interpreting an end user certificate as a CA.
|
172
|
+
|
173
|
+
basicConstraints=CA:FALSE
|
174
|
+
|
175
|
+
# Here are some examples of the usage of nsCertType. If it is omitted
|
176
|
+
# the certificate can be used for anything *except* object signing.
|
177
|
+
|
178
|
+
# This is OK for an SSL server.
|
179
|
+
# nsCertType = server
|
180
|
+
|
181
|
+
# For an object signing certificate this would be used.
|
182
|
+
# nsCertType = objsign
|
183
|
+
|
184
|
+
# For normal client use this is typical
|
185
|
+
# nsCertType = client, email
|
186
|
+
|
187
|
+
# and for everything including object signing:
|
188
|
+
# nsCertType = client, email, objsign
|
189
|
+
|
190
|
+
# This is typical in keyUsage for a client certificate.
|
191
|
+
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
192
|
+
|
193
|
+
# This will be displayed in Netscape's comment listbox.
|
194
|
+
nsComment = "OpenSSL Generated Certificate"
|
195
|
+
|
196
|
+
# PKIX recommendations harmless if included in all certificates.
|
197
|
+
subjectKeyIdentifier=hash
|
198
|
+
authorityKeyIdentifier=keyid,issuer
|
199
|
+
|
200
|
+
# This stuff is for subjectAltName and issuerAltname.
|
201
|
+
# Import the email address.
|
202
|
+
# subjectAltName=email:copy
|
203
|
+
# An alternative to produce certificates that aren't
|
204
|
+
# deprecated according to PKIX.
|
205
|
+
# subjectAltName=email:move
|
206
|
+
|
207
|
+
# Copy subject details
|
208
|
+
# issuerAltName=issuer:copy
|
209
|
+
|
210
|
+
#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
|
211
|
+
#nsBaseUrl
|
212
|
+
#nsRevocationUrl
|
213
|
+
#nsRenewalUrl
|
214
|
+
#nsCaPolicyUrl
|
215
|
+
#nsSslServerName
|
216
|
+
|
217
|
+
# This is required for TSA certificates.
|
218
|
+
# extendedKeyUsage = critical,timeStamping
|
219
|
+
|
220
|
+
[ v3_req ]
|
221
|
+
|
222
|
+
# Extensions to add to a certificate request
|
223
|
+
|
224
|
+
basicConstraints = CA:FALSE
|
225
|
+
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
226
|
+
|
227
|
+
[ v3_ca ]
|
228
|
+
|
229
|
+
|
230
|
+
# Extensions for a typical CA
|
231
|
+
|
232
|
+
|
233
|
+
# PKIX recommendation.
|
234
|
+
|
235
|
+
subjectKeyIdentifier=hash
|
236
|
+
|
237
|
+
authorityKeyIdentifier=keyid:always,issuer
|
238
|
+
|
239
|
+
# This is what PKIX recommends but some broken software chokes on critical
|
240
|
+
# extensions.
|
241
|
+
#basicConstraints = critical,CA:true
|
242
|
+
# So we do this instead.
|
243
|
+
basicConstraints = CA:true
|
244
|
+
|
245
|
+
# Key usage: this is typical for a CA certificate. However since it will
|
246
|
+
# prevent it being used as an test self-signed certificate it is best
|
247
|
+
# left out by default.
|
248
|
+
# keyUsage = cRLSign, keyCertSign
|
249
|
+
|
250
|
+
# Some might want this also
|
251
|
+
# nsCertType = sslCA, emailCA
|
252
|
+
|
253
|
+
# Include email address in subject alt name: another PKIX recommendation
|
254
|
+
# subjectAltName=email:copy
|
255
|
+
# Copy issuer details
|
256
|
+
# issuerAltName=issuer:copy
|
257
|
+
|
258
|
+
# DER hex encoding of an extension: beware experts only!
|
259
|
+
# obj=DER:02:03
|
260
|
+
# Where 'obj' is a standard or added object
|
261
|
+
# You can even override a supported extension:
|
262
|
+
# basicConstraints= critical, DER:30:03:01:01:FF
|
263
|
+
|
264
|
+
[ crl_ext ]
|
265
|
+
|
266
|
+
# CRL extensions.
|
267
|
+
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
|
268
|
+
|
269
|
+
# issuerAltName=issuer:copy
|
270
|
+
authorityKeyIdentifier=keyid:always
|
271
|
+
|
272
|
+
[ proxy_cert_ext ]
|
273
|
+
# These extensions should be added when creating a proxy certificate
|
274
|
+
|
275
|
+
# This goes against PKIX guidelines but some CAs do it and some software
|
276
|
+
# requires this to avoid interpreting an end user certificate as a CA.
|
277
|
+
|
278
|
+
basicConstraints=CA:FALSE
|
279
|
+
|
280
|
+
# Here are some examples of the usage of nsCertType. If it is omitted
|
281
|
+
# the certificate can be used for anything *except* object signing.
|
282
|
+
|
283
|
+
# This is OK for an SSL server.
|
284
|
+
# nsCertType = server
|
285
|
+
|
286
|
+
# For an object signing certificate this would be used.
|
287
|
+
# nsCertType = objsign
|
288
|
+
|
289
|
+
# For normal client use this is typical
|
290
|
+
# nsCertType = client, email
|
291
|
+
|
292
|
+
# and for everything including object signing:
|
293
|
+
# nsCertType = client, email, objsign
|
294
|
+
|
295
|
+
# This is typical in keyUsage for a client certificate.
|
296
|
+
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
297
|
+
|
298
|
+
# This will be displayed in Netscape's comment listbox.
|
299
|
+
nsComment = "OpenSSL Generated Certificate"
|
300
|
+
|
301
|
+
# PKIX recommendations harmless if included in all certificates.
|
302
|
+
subjectKeyIdentifier=hash
|
303
|
+
authorityKeyIdentifier=keyid,issuer
|
304
|
+
|
305
|
+
# This stuff is for subjectAltName and issuerAltname.
|
306
|
+
# Import the email address.
|
307
|
+
# subjectAltName=email:copy
|
308
|
+
# An alternative to produce certificates that aren't
|
309
|
+
# deprecated according to PKIX.
|
310
|
+
# subjectAltName=email:move
|
311
|
+
|
312
|
+
# Copy subject details
|
313
|
+
# issuerAltName=issuer:copy
|
314
|
+
|
315
|
+
#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem
|
316
|
+
#nsBaseUrl
|
317
|
+
#nsRevocationUrl
|
318
|
+
#nsRenewalUrl
|
319
|
+
#nsCaPolicyUrl
|
320
|
+
#nsSslServerName
|
321
|
+
|
322
|
+
# This really needs to be in place for it to be a proxy certificate.
|
323
|
+
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
|
324
|
+
|
325
|
+
####################################################################
|
326
|
+
[ tsa ]
|
327
|
+
|
328
|
+
default_tsa = tsa_config1 # the default TSA section
|
329
|
+
|
330
|
+
[ tsa_config1 ]
|
331
|
+
|
332
|
+
# These are used by the TSA reply generation only.
|
333
|
+
dir = ./demoCA # TSA root directory
|
334
|
+
serial = $dir/tsaserial # The current serial number (mandatory)
|
335
|
+
crypto_device = builtin # OpenSSL engine to use for signing
|
336
|
+
signer_cert = $dir/tsacert.pem # The TSA signing certificate
|
337
|
+
# (optional)
|
338
|
+
certs = $dir/cacert.pem # Certificate chain to include in reply
|
339
|
+
# (optional)
|
340
|
+
signer_key = $dir/private/tsakey.pem # The TSA private key (optional)
|
341
|
+
|
342
|
+
default_policy = tsa_policy1 # Policy if request did not specify it
|
343
|
+
# (optional)
|
344
|
+
other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional)
|
345
|
+
digests = md5, sha1 # Acceptable message digests (mandatory)
|
346
|
+
accuracy = secs:1, millisecs:500, microsecs:100 # (optional)
|
347
|
+
clock_precision_digits = 0 # number of digits after dot. (optional)
|
348
|
+
ordering = yes # Is ordering defined for timestamps?
|
349
|
+
# (optional, default: no)
|
350
|
+
tsa_name = yes # Must the TSA name be included in the reply?
|
351
|
+
# (optional, default: no)
|
352
|
+
ess_cert_id_chain = no # Must the ESS cert id chain be included?
|
353
|
+
# (optional, default: no)
|
data/siriproxy.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "siriproxy/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "siriproxy"
|
7
|
+
s.version = SiriProxy::VERSION
|
8
|
+
s.authors = ["plamoni", "chendo", "netpro2k"]
|
9
|
+
s.email = ["plamoni@siriproxy.info"]
|
10
|
+
s.homepage = "http://www.github.com/plamoni/SiriProxy"
|
11
|
+
s.summary = %q{A (tampering) proxy server for Apple's Siri}
|
12
|
+
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.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "siriproxy"
|
15
|
+
|
16
|
+
s.files = `git ls-files 2> /dev/null`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/* 2> /dev/null`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/* 2> /dev/null`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
|
22
|
+
|
23
|
+
s.add_runtime_dependency "CFPropertyList", "=2.1.2"
|
24
|
+
s.add_runtime_dependency "eventmachine"
|
25
|
+
s.add_runtime_dependency "uuidtools"
|
26
|
+
s.add_development_dependency "rake"
|
27
|
+
end
|