summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-05-13 00:12:49 -0700
committerelijah <elijah@riseup.net>2013-05-13 00:12:49 -0700
commitb078659defeead5b68ca2f387d0e308fa7511eb4 (patch)
tree34cfa1b1c832da5bab0661eb4378dfe312a2a4fd /lib
parent887de21aeae8c784ff49c2d34fe2c7606d5bc94e (diff)
s/sks_url/hkp_url
Diffstat (limited to 'lib')
-rw-r--r--lib/nickserver/config.rb2
-rw-r--r--lib/nickserver/hkp/fetch_key.rb7
-rw-r--r--lib/nickserver/hkp/fetch_key_info.rb2
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/nickserver/config.rb b/lib/nickserver/config.rb
index 56478e2..779f0a8 100644
--- a/lib/nickserver/config.rb
+++ b/lib/nickserver/config.rb
@@ -8,7 +8,7 @@ module Nickserver
]
class << self
- attr_accessor :sks_url
+ attr_accessor :hkp_url
attr_accessor :couch_port
attr_accessor :couch_host
attr_accessor :couch_database
diff --git a/lib/nickserver/hkp/fetch_key.rb b/lib/nickserver/hkp/fetch_key.rb
index c72ee11..211ae92 100644
--- a/lib/nickserver/hkp/fetch_key.rb
+++ b/lib/nickserver/hkp/fetch_key.rb
@@ -1,5 +1,10 @@
require 'em-http'
+#
+# Fetch keys via HKP
+# http://tools.ietf.org/html/draft-shaw-openpgp-hkp-00
+#
+
module Nickserver; module HKP
class FetchKey
@@ -22,7 +27,7 @@ module Nickserver; module HKP
#
def get_key_by_fingerprint(key_id)
params = {:op => 'get', :search => "0x" + key_id, :exact => 'on', :options => 'mr'}
- http = EventMachine::HttpRequest.new(Config.sks_url).get(:query => params)
+ http = EventMachine::HttpRequest.new(Config.hkp_url).get(:query => params)
http.callback {
if http.response_header.status != 200
self.fail http.response_header.status #"Request failed with #{http.response_header.status}: #{http.response}"
diff --git a/lib/nickserver/hkp/fetch_key_info.rb b/lib/nickserver/hkp/fetch_key_info.rb
index 48ef48a..dce0326 100644
--- a/lib/nickserver/hkp/fetch_key_info.rb
+++ b/lib/nickserver/hkp/fetch_key_info.rb
@@ -15,7 +15,7 @@ module Nickserver; module HKP
def search(uid)
# in practice, exact=on seems to have no effect
params = {:op => 'vindex', :search => uid, :exact => 'on', :options => 'mr', :fingerprint => 'on'}
- EventMachine::HttpRequest.new(Config.sks_url).get(:query => params).callback {|http|
+ EventMachine::HttpRequest.new(Config.hkp_url).get(:query => params).callback {|http|
if http.response_header.status != 200
self.fail http.response_header.status
else