Merge lp:~zorba-coders/zorba/bug-1188056 into lp:zorba/security-module

Proposed by Chris Hillery on 2013-08-29
Status: Merged
Merged at revision: 32
Proposed branch: lp:~zorba-coders/zorba/bug-1188056
Merge into: lp:zorba/security-module
Diff against target: 230 lines (+25/-25)
14 files modified
src/CMakeLists.txt (+4/-4)
src/hash.xq (+5/-5)
src/hash.xq.src/hash.cpp (+1/-1)
src/hash.xq.src/hash.h (+1/-1)
src/hmac.xq (+5/-5)
src/hmac.xq.src/hmac.cpp (+1/-1)
src/hmac.xq.src/hmac.h (+1/-1)
test/Queries/security/hash-binary.xq (+1/-1)
test/Queries/security/hash-binary2.xq (+1/-1)
test/Queries/security/hash-md5.xq (+1/-1)
test/Queries/security/hash-sha1.xq (+1/-1)
test/Queries/security/hash-sha256.xq (+1/-1)
test/Queries/security/hmac-sha1.xq (+1/-1)
test/Queries/security/hmac-sha256.xq (+1/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1188056
Reviewer Review Type Date Requested Status
Chris Hillery Approve on 2013-09-20
Luis Rodriguez Gonzalez Approve on 2013-08-29
Review via email: mp+182790@code.launchpad.net

Commit message

Changes for Zorba 3.0 for security module.

To post a comment you must log in.
Chris Hillery (ceejatec) wrote :

1. sha256 test failures.

2. There are error codes thrown like hmac:unsupported-algorithm; they should be like hmac:UNSUPPORTED_ALGORITHM, and the XQDoc should be updated accordingly.

review: Needs Fixing
lp:~zorba-coders/zorba/bug-1188056 updated on 2013-08-29
33. By Luis Rodriguez Gonzalez on 2013-08-29

refixed decode() call

34. By Luis Rodriguez Gonzalez on 2013-08-29

fixed errors in documentation

Luis Rodriguez Gonzalez (kuraru) wrote :

> 1. sha256 test failures.
>
> 2. There are error codes thrown like hmac:unsupported-algorithm; they should
> be like hmac:UNSUPPORTED_ALGORITHM, and the XQDoc should be updated
> accordingly.

both errors are fixed now.

review: Approve
Chris Hillery (ceejatec) :
review: Approve
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/bug-1188056/+merge/182790

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/bug-1188056/+merge/182790

Stage "TestZorbaUbuntu" failed.
1 tests failed (8492 total tests run).

Check test results at http://jenkins.lambda.nu/job/TestZorbaUbuntu/303/testReport/ to view the results.

Chris Hillery (ceejatec) wrote :

Looks like you will need to create a secondary merge proposal which updates the oauth module (which uses the hmac module that you're changing here).

review: Needs Fixing
Luis Rodriguez Gonzalez (kuraru) wrote :

> Looks like you will need to create a secondary merge proposal which updates
> the oauth module (which uses the hmac module that you're changing here).
I just created lp:~zorba-coders/zorba/bug-1188056-oauth to change that uri.

Chris Hillery (ceejatec) :
review: Approve
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2012-07-20 16:13:37 +0000
3+++ src/CMakeLists.txt 2013-08-29 20:00:27 +0000
4@@ -13,14 +13,14 @@
5 # limitations under the License.
6
7 DECLARE_ZORBA_MODULE (
8- URI "http://www.zorba-xquery.com/modules/cryptography/hmac"
9- VERSION 2.0
10+ URI "http://zorba.io/modules/hmac"
11+ VERSION 1.0
12 FILE "hmac.xq"
13 LINK_LIBRARIES ${OPENSSL_LIBRARIES}
14 )
15 DECLARE_ZORBA_MODULE (
16- URI "http://www.zorba-xquery.com/modules/cryptography/hash"
17- VERSION 2.0
18+ URI "http://zorba.io/modules/hash"
19+ VERSION 1.0
20 FILE "hash.xq"
21 LINK_LIBRARIES ${OPENSSL_LIBRARIES}
22 )
23
24=== modified file 'src/hash.xq'
25--- src/hash.xq 2013-08-09 09:37:05 +0000
26+++ src/hash.xq 2013-08-29 20:00:27 +0000
27@@ -1,4 +1,4 @@
28-xquery version "1.0";
29+xquery version "3.0";
30
31 (:
32 : Copyright 2006-2012 The FLWOR Foundation.
33@@ -24,10 +24,10 @@
34 : @author Gabriel Petrovay, Markus Pilman, Matthias Brantner
35 : @project Zorba/Cryptography/Hash
36 :)
37-module namespace hash = "http://www.zorba-xquery.com/modules/cryptography/hash";
38+module namespace hash = "http://zorba.io/modules/hash";
39
40 declare namespace ver = "http://zorba.io/options/versioning";
41-declare option ver:module-version "2.0";
42+declare option ver:module-version "1.0";
43
44 (:~
45 : Computes the MD5 hash of the string provided as parameter.
46@@ -94,7 +94,7 @@
47 :
48 : @return The hash as xs:base64binary of the provided string
49 :
50- : @error hash:unsupported-algorithm if the given hash algorithm is not
51+ : @error hash:UNSUPPORTED-ALGORITHM if the given hash algorithm is not
52 : supported
53 :)
54 declare function hash:hash($value as xs:string, $alg as xs:string)
55@@ -111,7 +111,7 @@
56 :
57 : @return The hash as xs:base64Binary of the provided binary
58 :
59- : @error hash:unsupported-algorithm if the given hash algorithm is not
60+ : @error hash:UNSUPPORTED-ALGORITHM if the given hash algorithm is not
61 : supported
62 :)
63 declare function hash:hash-binary($value as xs:base64Binary, $alg as xs:string)
64
65=== modified file 'src/hash.xq.src/hash.cpp'
66--- src/hash.xq.src/hash.cpp 2013-06-12 05:17:59 +0000
67+++ src/hash.xq.src/hash.cpp 2013-08-29 20:00:27 +0000
68@@ -130,7 +130,7 @@
69 lMsg << lAlg << ": unsupported hash algorithm";
70 throw USER_EXCEPTION(
71 getItemFactory()->createQName(
72- getURI(), "unsupported-algorithm"),
73+ getURI(), "UNSUPPORTED-ALGORITHM"),
74 lMsg.str());
75 }
76 return zorba::ItemSequence_t(new EmptySequence());
77
78=== modified file 'src/hash.xq.src/hash.h'
79--- src/hash.xq.src/hash.h 2013-07-30 18:47:17 +0000
80+++ src/hash.xq.src/hash.h 2013-08-29 20:00:27 +0000
81@@ -49,7 +49,7 @@
82 virtual ~HashModule();
83
84 virtual String
85- getURI() const { return "http://www.zorba-xquery.com/modules/cryptography/hash"; }
86+ getURI() const { return "http://zorba.io/modules/hash"; }
87
88 virtual ExternalFunction*
89 getExternalFunction(const String& aLocalname);
90
91=== modified file 'src/hmac.xq'
92--- src/hmac.xq 2013-08-09 09:37:05 +0000
93+++ src/hmac.xq 2013-08-29 20:00:27 +0000
94@@ -1,4 +1,4 @@
95-xquery version "1.0";
96+xquery version "3.0";
97
98 (:
99 : Copyright 2006-2012 The FLWOR Foundation.
100@@ -28,10 +28,10 @@
101 : @project Zorba/Cryptography/HMAC
102 :
103 :)
104-module namespace hmac = "http://www.zorba-xquery.com/modules/cryptography/hmac";
105+module namespace hmac = "http://zorba.io/modules/hmac";
106
107 declare namespace ver = "http://zorba.io/options/versioning";
108-declare option ver:module-version "2.0";
109+declare option ver:module-version "1.0";
110
111 (:~
112 : Calculate the HMAC for the given message and secret-key involving
113@@ -114,7 +114,7 @@
114 :
115 : @return the base64 encoded message authentication code
116 :
117- : @error hash:unsupported-algorithm if the given hash algorithm is not
118+ : @error hash:UNSUPPORTED-ALGORITHM if the given hash algorithm is not
119 : supported
120 :)
121 declare function hmac:compute(
122@@ -135,7 +135,7 @@
123 :
124 : @return the base64 encoded message authentication code
125 :
126- : @error hash:unsupported-algorithm if the given hash algorithm is not
127+ : @error hash:UNSUPPORTED-ALGORITHM if the given hash algorithm is not
128 : supported
129 :)
130 declare function hmac:compute-binary(
131
132=== modified file 'src/hmac.xq.src/hmac.cpp'
133--- src/hmac.xq.src/hmac.cpp 2013-07-30 18:36:20 +0000
134+++ src/hmac.xq.src/hmac.cpp 2013-08-29 20:00:27 +0000
135@@ -120,7 +120,7 @@
136 lMsg << aAlg << ": unsupported hash algorithm";
137 throw USER_EXCEPTION(
138 HMACModule::getItemFactory()->createQName(
139- "http://www.zorba-xquery.com/modules/cryptography/hmac", "unsupported-algorithm"),
140+ "http://zorba.io/modules/hmac", "UNSUPPORTED-ALGORITHM"),
141 lMsg.str());
142 }
143 }
144
145=== modified file 'src/hmac.xq.src/hmac.h'
146--- src/hmac.xq.src/hmac.h 2012-07-20 16:13:37 +0000
147+++ src/hmac.xq.src/hmac.h 2013-08-29 20:00:27 +0000
148@@ -49,7 +49,7 @@
149 virtual ~HMACModule();
150
151 virtual String
152- getURI() const { return "http://www.zorba-xquery.com/modules/cryptography/hmac"; }
153+ getURI() const { return "http://zorba.io/modules/hmac"; }
154
155 virtual ExternalFunction*
156 getExternalFunction(const String& aLocalname);
157
158=== modified file 'test/Queries/security/hash-binary.xq'
159--- test/Queries/security/hash-binary.xq 2012-07-20 03:32:59 +0000
160+++ test/Queries/security/hash-binary.xq 2013-08-29 20:00:27 +0000
161@@ -1,4 +1,4 @@
162-import module namespace hash = "http://www.zorba-xquery.com/modules/cryptography/hash";
163+import module namespace hash = "http://zorba.io/modules/hash";
164 import module namespace f = "http://expath.org/ns/file";
165
166 xs:hexBinary(hash:hash-binary(f:read-binary(resolve-uri("ls")), "sha256"))
167
168=== modified file 'test/Queries/security/hash-binary2.xq'
169--- test/Queries/security/hash-binary2.xq 2012-10-23 21:12:37 +0000
170+++ test/Queries/security/hash-binary2.xq 2013-08-29 20:00:27 +0000
171@@ -1,5 +1,5 @@
172 import module namespace f = "http://expath.org/ns/file";
173-import module namespace hash = "http://www.zorba-xquery.com/modules/cryptography/hash";
174+import module namespace hash = "http://zorba.io/modules/hash";
175
176 variable $f := f:read-binary(resolve-uri("ls"));
177
178
179=== modified file 'test/Queries/security/hash-md5.xq'
180--- test/Queries/security/hash-md5.xq 2012-07-20 16:13:37 +0000
181+++ test/Queries/security/hash-md5.xq 2013-08-29 20:00:27 +0000
182@@ -1,5 +1,5 @@
183 (: Values compared to php -r 'echo base64_encode(sha1($string, true));' :)
184-import module namespace hash = "http://www.zorba-xquery.com/modules/cryptography/hash";
185+import module namespace hash = "http://zorba.io/modules/hash";
186
187 xs:hexBinary(hash:md5("abc")),
188 hash:md5("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq")
189
190=== modified file 'test/Queries/security/hash-sha1.xq'
191--- test/Queries/security/hash-sha1.xq 2011-07-05 03:24:29 +0000
192+++ test/Queries/security/hash-sha1.xq 2013-08-29 20:00:27 +0000
193@@ -1,5 +1,5 @@
194 (: Values compared to php -r 'echo base64_encode(sha1($string, true));' :)
195-import module namespace hash = "http://www.zorba-xquery.com/modules/cryptography/hash";
196+import module namespace hash = "http://zorba.io/modules/hash";
197
198 hash:sha1("abc"),
199 hash:sha1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq")
200
201=== modified file 'test/Queries/security/hash-sha256.xq'
202--- test/Queries/security/hash-sha256.xq 2012-07-20 16:13:37 +0000
203+++ test/Queries/security/hash-sha256.xq 2013-08-29 20:00:27 +0000
204@@ -1,5 +1,5 @@
205 (: Values compared to php -r 'echo base64_encode(sha1($string, true));' :)
206-import module namespace hash = "http://www.zorba-xquery.com/modules/cryptography/hash";
207+import module namespace hash = "http://zorba.io/modules/hash";
208
209 hash:hash("abc", "sha256"),
210 hash:hash("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "sha256"),
211
212=== modified file 'test/Queries/security/hmac-sha1.xq'
213--- test/Queries/security/hmac-sha1.xq 2011-07-05 03:24:29 +0000
214+++ test/Queries/security/hmac-sha1.xq 2013-08-29 20:00:27 +0000
215@@ -1,4 +1,4 @@
216-import module namespace hmac = "http://www.zorba-xquery.com/modules/cryptography/hmac";
217+import module namespace hmac = "http://zorba.io/modules/hmac";
218
219 hmac:sha1("foo", "bar"),
220 hmac:sha1("GET&amp;http%3A%2F%2Ftwitter.com%2Faccount%2Fverify_credentials.xml&amp;oauth_consumer_key%3DAJNRLGd7aT0SvQMLjudog%26oauth_nonce%3D4996802908718844015%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1274195088%26oauth_token%3D131201600-tHRlNpwN6JmJsNjDYBgHgccV9fvdOD5e4f8j3BZd%26oauth_version%3D1.0", "TfV0JLBWBBslSuCLwrWcC8q4PxPGmFSgyhc4ewHNY4")
221
222=== modified file 'test/Queries/security/hmac-sha256.xq'
223--- test/Queries/security/hmac-sha256.xq 2012-07-20 16:13:37 +0000
224+++ test/Queries/security/hmac-sha256.xq 2013-08-29 20:00:27 +0000
225@@ -1,4 +1,4 @@
226-import module namespace hash = "http://www.zorba-xquery.com/modules/cryptography/hmac";
227+import module namespace hash = "http://zorba.io/modules/hmac";
228 import module namespace f = "http://expath.org/ns/file";
229
230 hash:compute-binary(xs:base64Binary("Zm9vCg=="), "bar", "sha256"),

Subscribers

People subscribed via source and target branches

to all changes: