(params, data)
| 25 | else utils.password_score(password) or has_passkey(record) and 100 or 0 |
| 26 | |
| 27 | def encrypt_security_data(params, data): |
| 28 | if params.forbid_rsa and not params.enterprise_ec_key: |
| 29 | raise Exception('Enterprise ECC public key is not available') |
| 30 | |
| 31 | if not params.forbid_rsa and not params.enterprise_rsa_key: |
| 32 | raise Exception('Enterprise RSA public key is not available') |
| 33 | |
| 34 | data = json.dumps(data).encode('utf8') |
| 35 | pubkey = params.enterprise_ec_key if params.forbid_rsa else params.enterprise_rsa_key |
| 36 | encrypt_fn = crypto.encrypt_ec if params.forbid_rsa else crypto.encrypt_rsa |
| 37 | return encrypt_fn(data, pubkey) |
| 38 | |
| 39 | def prep_security_data(params, record): |
| 40 | get_bw_obj = lambda rec: next( |
no outgoing calls
no test coverage detected