From c9a15200f08d40443768813760b23b2bc9925bf4 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Fri, 1 Apr 2011 11:55:58 +0000 Subject: Fix OAuth signature computation in OTP R14B02 In OTP versions prior to R14B02, the OAuth signature was correctly calculated due to a bug in the OTP stdlib. This was fixed in R14B02 (OTP-8989, check http://erlang.org/download/otp_src_R14B02.readme). Before R14B02: Erlang R14B01 (erts-5.8.2) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.8.2 (abort with ^G) 1> lists:flatten(io_lib:format("%~2.1.0s", [erlang:integer_to_list($+, 16)])). "%2B" In R14B02: Erlang R14B02 (erts-5.8.3) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.8.3 (abort with ^G) 1> lists:flatten(io_lib:format("%~2.1.0s", [erlang:integer_to_list($+, 16)])). "%02" This doesn't affect the erlang-oauth application in trunk, since it's a more recent version with a different implementation. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1087661 13f79535-47bb-0310-9956-ffa450edef68 --- src/erlang-oauth/oauth_uri.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/erlang-oauth/oauth_uri.erl b/src/erlang-oauth/oauth_uri.erl index fb27ae72..3bdc9076 100644 --- a/src/erlang-oauth/oauth_uri.erl +++ b/src/erlang-oauth/oauth_uri.erl @@ -84,5 +84,5 @@ encode([], Encoded) -> encode([C|Etc], Encoded) when ?is_unreserved(C) -> encode(Etc, [C|Encoded]); encode([C|Etc], Encoded) -> - Value = io_lib:format("%~2.1.0s", [erlang:integer_to_list(C, 16)]), + Value = io_lib:format("%~2.2.0s", [erlang:integer_to_list(C, 16)]), encode(Etc, [Value|Encoded]). -- cgit v1.2.3