diff --git a/upload-file.py b/upload-file.py index dffb31f..6ed0b6e 100644 --- a/upload-file.py +++ b/upload-file.py @@ -20,7 +20,9 @@ user_name = ''.join(random.choice(string.ascii_uppercase) for _ in range(10)) email = ''.join(random.choice(string.ascii_uppercase) for _ in range(10)) + "@"\ + ''.join(random.choice(string.ascii_uppercase) for _ in range(5)) + domain passphrase = ''.join(random.choice(string.ascii_uppercase) for _ in range(5)) -key_server = "eu.pool.sks-keyservers.net" #any key server is good as it will propogate world wide + +#any key server is good as it will propogate world wide +key_server = "eu.pool.sks-keyservers.net" #unattended key generation p = subprocess.Popen('gpg2 --batch --pinentry-mode=loopback --passphrase ' + passphrase +\ @@ -29,10 +31,10 @@ p = subprocess.Popen('gpg2 --batch --pinentry-mode=loopback --passphrase ' + pas out, err = p.communicate() #get pub key -p = subprocess.Popen('gpg2 --list-key ' + email, shell=True, stdout=subprocess.PIPE) +p = subprocess.Popen('gpg2 --list-key --with-colons ' + email, shell=True, stdout=subprocess.PIPE) out, err = p.communicate() - -key = out.split()[6] # parse out the key so we can use to send keys to the key servers +# parse out the key id so we can use it to send keys to the key servers +key = key = [x.replace(':', '').replace('fpr', '') for x in out.split() if "fpr" in x][0] #open file in binary and break it up into 1305byte chunks chunk_list = []