tlslite: restore python3 compatibility

dhe_rsa.patch uses some python 2 only constructs, replace with code
that is compatible with both 2 and 3.

Bug: chromium:1041448
Test: tast run <ip> policy.*
Change-Id: I4bba7c77512a2fb51b9b26a05781767f330da97e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035415
Reviewed-by: David Benjamin <davidben@chromium.org>
Commit-Queue: Victor-Gabriel Savu <vsavu@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#737800}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8ab71f107c2ee5cf9c1f275db24b6036dc9c2e78
2 files changed