Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed max 8192 bytes, fixes #8424 #8442

Merged
merged 1 commit into from
Aug 5, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions library/packaging/rpm_key
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ import os.path
import re
import tempfile

# Attempt to download at most 8192 bytes.
# Should be more than enough for all keys
MAXBYTES = 8192

def is_pubkey(string):
"""Verifies if string is a pubkey"""
pgp_regex = ".*?(-----BEGIN PGP PUBLIC KEY BLOCK-----.*?-----END PGP PUBLIC KEY BLOCK-----).*"
Expand Down Expand Up @@ -118,11 +114,11 @@ class RpmKey:
module.exit_json(changed=False)


def fetch_key(self, url, maxbytes=MAXBYTES):
def fetch_key(self, url):
"""Downloads a key from url, returns a valid path to a gpg key"""
try:
rsp, info = fetch_url(self.module, url)
key = rsp.read(maxbytes)
key = rsp.read()
if not is_pubkey(key):
self.module.fail_json(msg="Not a public key: %s" % url)
tmpfd, tmpname = tempfile.mkstemp()
Expand Down