0001-sips2-fix-seal-check-10008.patch
eopayment/sips2.py | ||
---|---|---|
1 | 1 |
# -*- coding: utf-8 -*- |
2 |
import collections |
|
2 | 3 |
import urlparse |
3 | 4 |
import string |
4 | 5 |
from decimal import Decimal |
... | ... | |
180 | 181 |
def decode_data(self, data): |
181 | 182 |
data = data.split('|') |
182 | 183 |
data = [map(unicode, p.split('=')) for p in data] |
183 |
return dict(data)
|
|
184 |
return collections.OrderedDict(data)
|
|
184 | 185 | |
185 | 186 |
def check_seal(self, data, seal): |
186 | 187 |
return seal == self.seal_data(data) |
... | ... | |
197 | 198 |
assert 'Seal' in form |
198 | 199 |
assert 'InterfaceVersion' in form |
199 | 200 |
data = self.decode_data(form['Data'][0]) |
200 |
seal = form['Seal'] |
|
201 |
seal = form['Seal'][0]
|
|
201 | 202 |
self.logger.debug('parsed response %r seal %r', data, seal) |
202 | 203 |
signed = self.check_seal(data, seal) |
203 | 204 |
response_code = data['responseCode'] |
204 |
- |