Create HA1 hash by realm, username, password HA1 = md5(A1) = MD5(username:realm:password)
(realm, username, password, algorithm)
| 277 | |
| 278 | |
| 279 | def HA1(realm, username, password, algorithm): |
| 280 | """Create HA1 hash by realm, username, password |
| 281 | |
| 282 | HA1 = md5(A1) = MD5(username:realm:password) |
| 283 | """ |
| 284 | if not realm: |
| 285 | realm = u'' |
| 286 | return H(b":".join([username.encode('utf-8'), |
| 287 | realm.encode('utf-8'), |
| 288 | password.encode('utf-8')]), algorithm) |
| 289 | |
| 290 | |
| 291 | def HA2(credentails, request, algorithm): |