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

Proposed by Paul J. Lucas
Status: Merged
Merged at revision: 29
Proposed branch: lp:~zorba-coders/zorba/bug-1158052-security
Merge into: lp:zorba/security-module
Diff against target: 90 lines (+32/-15)
2 files modified
src/hash.xq.src/hash.h (+16/-11)
src/hmac.xq.src/hmac.cpp (+16/-4)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1158052-security
Reviewer Review Type Date Requested Status
Chris Hillery Approve
Paul J. Lucas Approve
Review via email: mp+170950@code.launchpad.net

Commit message

Corresponding changes for bug #1158052.

Description of the change

Corresponding changes for bug #1158052.

To post a comment you must log in.
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
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
=== modified file 'src/hash.xq.src/hash.h'
--- src/hash.xq.src/hash.h 2013-06-12 05:17:59 +0000
+++ src/hash.xq.src/hash.h 2013-06-22 13:18:25 +0000
@@ -132,24 +132,28 @@
132 lLen = lTmpDecodedBuf.size();132 lLen = lTmpDecodedBuf.size();
133 }133 }
134 (*hash)(134 (*hash)(
135 reinterpret_cast<const unsigned char*>(lTmp),135 reinterpret_cast<const unsigned char*>(lTmp),
136 lLen,136 lLen,
137 &lBuf[0]137 &lBuf[0]
138 );138 );
139 }139 }
140 else140 else
141 {141 {
142 String lTmp = aMessage.getStringValue();142 String lTmp = aMessage.getStringValue();
143 (*hash)(143 (*hash)(
144 reinterpret_cast<const unsigned char*>(lTmp.data()),144 reinterpret_cast<const unsigned char*>(lTmp.data()),
145 lTmp.size(),145 lTmp.size(),
146 &lBuf[0]146 &lBuf[0]
147 );147 );
148 }148 }
149 }149 }
150 return150 return zorba::ItemSequence_t(
151 zorba::ItemSequence_t(new zorba::SingletonItemSequence(151 new zorba::SingletonItemSequence(
152 getItemFactory()->createBase64Binary(&lBuf[0], DIGEST_LENGTH)));152 getItemFactory()->createBase64Binary(
153 reinterpret_cast<char const*>(&lBuf[0]), DIGEST_LENGTH, false
154 )
155 )
156 );
153 }157 }
154 };158 };
155159
@@ -203,3 +207,4 @@
203} /* namespace zorba */207} /* namespace zorba */
204208
205#endif209#endif
210/* vim:set et sw=2 ts=2: */
206211
=== modified file 'src/hmac.xq.src/hmac.cpp'
--- src/hmac.xq.src/hmac.cpp 2013-06-12 05:17:59 +0000
+++ src/hmac.xq.src/hmac.cpp 2013-06-22 13:18:25 +0000
@@ -164,8 +164,13 @@
164 HMAC_Final(&ctx, out, &len);164 HMAC_Final(&ctx, out, &len);
165 HMAC_cleanup(&ctx);165 HMAC_cleanup(&ctx);
166166
167 return zorba::ItemSequence_t(new zorba::SingletonItemSequence(167 return zorba::ItemSequence_t(
168 theModule->getItemFactory()->createBase64Binary(&out[0], len)));168 new zorba::SingletonItemSequence(
169 theModule->getItemFactory()->createBase64Binary(
170 reinterpret_cast<char const*>(&out[0]), len, false
171 )
172 )
173 );
169}174}
170175
171zorba::ItemSequence_t176zorba::ItemSequence_t
@@ -227,8 +232,13 @@
227 HMAC_Final(&ctx, out, &len);232 HMAC_Final(&ctx, out, &len);
228 HMAC_cleanup(&ctx);233 HMAC_cleanup(&ctx);
229234
230 return zorba::ItemSequence_t(new zorba::SingletonItemSequence(235 return zorba::ItemSequence_t(
231 theModule->getItemFactory()->createBase64Binary(&out[0], len)));236 new zorba::SingletonItemSequence(
237 theModule->getItemFactory()->createBase64Binary(
238 reinterpret_cast<char const*>(&out[0]), len, false
239 )
240 )
241 );
232}242}
233243
234} /* namespace security */ } /* namespace zorba */244} /* namespace security */ } /* namespace zorba */
@@ -242,3 +252,5 @@
242extern "C" DLL_EXPORT zorba::ExternalModule* createModule() {252extern "C" DLL_EXPORT zorba::ExternalModule* createModule() {
243 return new zorba::security::HMACModule();253 return new zorba::security::HMACModule();
244}254}
255
256/* vim:set et sw=2 ts=2: */

Subscribers

People subscribed via source and target branches

to all changes: