summaryrefslogtreecommitdiffabout
path: root/lib
Unidiff
Diffstat (limited to 'lib') (more/less context) (show whitespace changes)
-rw-r--r--lib/params.cc13
-rw-r--r--lib/secret.cc12
2 files changed, 17 insertions, 8 deletions
diff --git a/lib/params.cc b/lib/params.cc
index ea86d3a..7a572c1 100644
--- a/lib/params.cc
+++ b/lib/params.cc
@@ -101,2 +101,15 @@ namespace opkele {
101 101
102 string params_t::query_string(const char *prefix) const {
103 string rv;
104 for(const_iterator i=begin();i!=end();++i) {
105 if(!rv.empty())
106 rv += '&';
107 rv += prefix;
108 rv += i->first;
109 rv += '=';
110 rv += util::url_encode(i->second);
111 }
112 return rv;
113 }
114
102 ostream& operator << (ostream& o,const params_t& p) { 115 ostream& operator << (ostream& o,const params_t& p) {
diff --git a/lib/secret.cc b/lib/secret.cc
index 632a2ca..d538890 100644
--- a/lib/secret.cc
+++ b/lib/secret.cc
@@ -16,5 +16,3 @@ namespace opkele {
16 16
17 void secret_t::enxor_to_base64(const unsigned char *key_sha1,string& rv) const { 17 void secret_t::enxor_to_base64(const unsigned char *key_d,string& rv) const {
18 if(size()!=20)
19 throw bad_input(OPKELE_CP_ "wrong secret size");
20 vector<unsigned char> tmp; 18 vector<unsigned char> tmp;
@@ -22,3 +20,3 @@ namespace opkele {
22 begin(), end(), 20 begin(), end(),
23 key_sha1, 21 key_d,
24 back_insert_iterator<vector<unsigned char> >(tmp), 22 back_insert_iterator<vector<unsigned char> >(tmp),
@@ -28,3 +26,3 @@ namespace opkele {
28 26
29 void secret_t::enxor_from_base64(const unsigned char *key_sha1,const string& b64) { 27 void secret_t::enxor_from_base64(const unsigned char *key_d,const string& b64) {
30 clear(); 28 clear();
@@ -33,3 +31,3 @@ namespace opkele {
33 begin(), end(), 31 begin(), end(),
34 key_sha1, 32 key_d,
35 begin(), 33 begin(),
@@ -39,4 +37,2 @@ namespace opkele {
39 void secret_t::to_base64(string& rv) const { 37 void secret_t::to_base64(string& rv) const {
40 if(size()!=20)
41 throw bad_input(OPKELE_CP_ "wrong secret size");
42 rv = util::encode_base64(&(front()),size()); 38 rv = util::encode_base64(&(front()),size());