From b078659defeead5b68ca2f387d0e308fa7511eb4 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 13 May 2013 00:12:49 -0700 Subject: s/sks_url/hkp_url --- lib/nickserver/config.rb | 2 +- lib/nickserver/hkp/fetch_key.rb | 7 ++++++- lib/nickserver/hkp/fetch_key_info.rb | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3