(self, arg=None)
| 918 | self.push('334 QnVHZ1liVWdHeQ==') |
| 919 | |
| 920 | def _auth_cram_md5(self, arg=None): |
| 921 | if arg is None: |
| 922 | self.push('334 {}'.format(sim_cram_md5_challenge)) |
| 923 | else: |
| 924 | logpass = self._decode_base64(arg) |
| 925 | try: |
| 926 | user, hashed_pass = logpass.split() |
| 927 | except ValueError as e: |
| 928 | self.push('535 Splitting response {!r} into user and password ' |
| 929 | 'failed: {}'.format(logpass, e)) |
| 930 | return |
| 931 | pwd = sim_auth[1].encode('ascii') |
| 932 | msg = self._decode_base64(sim_cram_md5_challenge).encode('ascii') |
| 933 | try: |
| 934 | valid_hashed_pass = hmac.HMAC(pwd, msg, 'md5').hexdigest() |
| 935 | except ValueError: |
| 936 | self.push('504 CRAM-MD5 is not supported') |
| 937 | return |
| 938 | self._authenticated(user, hashed_pass == valid_hashed_pass) |
| 939 | # end AUTH related stuff. |
| 940 | |
| 941 | def smtp_EHLO(self, arg): |
nothing calls this directly
no test coverage detected