ota_update: read password invisibly

This commit is contained in:
Thomas Kolb 2019-12-02 20:40:47 +01:00
parent 832b30f485
commit 48089dd526

View file

@ -5,6 +5,9 @@ import socket
import struct import struct
import hashlib import hashlib
import os import os
import time
from getpass import getpass
def readMessage(sock): def readMessage(sock):
data = sock.recv(4) data = sock.recv(4)
@ -28,7 +31,7 @@ with open("../data/etc/auth", "r") as authFile:
_, host, port, filename = sys.argv _, host, port, filename = sys.argv
# read and store the password from the user # read and store the password from the user
pwd = input("Enter password: ") pwd = getpass()
s = socket.create_connection( (host, int(port)) ) s = socket.create_connection( (host, int(port)) )