set locale explicitly when using keytool

This commit is contained in:
Michael Pöhn 2018-08-03 04:36:00 +02:00
parent 545872f184
commit 74ae6a6a3b
4 changed files with 15 additions and 13 deletions

View file

@ -59,11 +59,14 @@ def _ssh_key_from_debug_keystore(keystore=KEYSTORE_FILE):
'-srcstorepass', PASSWORD, '-srckeypass', PASSWORD,
'-destkeystore', p12, '-destalias', KEY_ALIAS,
'-deststorepass', PASSWORD, '-destkeypass', PASSWORD,
'-deststoretype', 'PKCS12'])
'-deststoretype', 'PKCS12'],
env={'LC_ALL': 'C.UTF-8'})
subprocess.check_call(['openssl', 'pkcs12', '-in', p12, '-out', key_pem,
'-passin', 'pass:' + PASSWORD, '-passout', 'pass:' + PASSWORD])
'-passin', 'pass:' + PASSWORD, '-passout', 'pass:' + PASSWORD],
env={'LC_ALL': 'C.UTF-8'})
subprocess.check_call(['openssl', 'rsa', '-in', key_pem, '-out', privkey,
'-passin', 'pass:' + PASSWORD])
'-passin', 'pass:' + PASSWORD],
env={'LC_ALL': 'C.UTF-8'})
os.remove(key_pem)
os.remove(p12)
os.chmod(privkey, 0o600) # os.umask() should cover this, but just in case