Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
d1e1e7e5
Commit
d1e1e7e5
authored
Sep 13, 2013
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes to handle non-ASCII names/config in student verification.
parent
b6a863fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lms/djangoapps/verify_student/ssencrypt.py
+3
-2
No files found.
lms/djangoapps/verify_student/ssencrypt.py
View file @
d1e1e7e5
...
@@ -131,7 +131,8 @@ def generate_signed_message(method, headers_dict, body_dict, access_key, secret_
...
@@ -131,7 +131,8 @@ def generate_signed_message(method, headers_dict, body_dict, access_key, secret_
body_str
=
body_string
(
body_dict
)
body_str
=
body_string
(
body_dict
)
message
=
headers_str
+
body_str
message
=
headers_str
+
body_str
hashed
=
hmac
.
new
(
secret_key
,
message
,
sha256
)
# hmac needs a byte string for it's starting key, can't be unicode.
hashed
=
hmac
.
new
(
secret_key
.
encode
(
'utf-8'
),
message
,
sha256
)
signature
=
binascii
.
b2a_base64
(
hashed
.
digest
())
.
rstrip
(
'
\n
'
)
signature
=
binascii
.
b2a_base64
(
hashed
.
digest
())
.
rstrip
(
'
\n
'
)
authorization_header
=
"SSI {}:{}"
.
format
(
access_key
,
signature
)
authorization_header
=
"SSI {}:{}"
.
format
(
access_key
,
signature
)
...
@@ -161,7 +162,7 @@ def body_string(body_dict):
...
@@ -161,7 +162,7 @@ def body_string(body_dict):
for
key
,
value
in
sorted
(
body_dict
.
items
()):
for
key
,
value
in
sorted
(
body_dict
.
items
()):
if
value
is
None
:
if
value
is
None
:
value
=
"null"
value
=
"null"
body_list
.
append
(
u"{}:{}
\n
"
.
format
(
key
,
value
))
body_list
.
append
(
u"{}:{}
\n
"
.
format
(
key
,
value
)
.
encode
(
'utf-8'
)
)
return
""
.
join
(
body_list
)
# Note that trailing \n's are important
return
""
.
join
(
body_list
)
# Note that trailing \n's are important
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment