Merge "Fix security vulnerabilities using Bandit"

This commit is contained in:
Zuul 2023-02-08 13:25:41 +00:00 committed by Gerrit Code Review
commit aa239130d6
4 changed files with 7 additions and 8 deletions

View File

@ -32,13 +32,12 @@ def upgrade():
# Remove instances of the new openid so the old one can take # Remove instances of the new openid so the old one can take
# its place. # its place.
query = "delete from user where openid='%s'" % (new_openid) query = "delete from user where openid=%%:user"
conn.execute(query.replace('%', '%%')) conn.execute(query, user=new_openid)
# Update the openid. # Update the openid.
query = ("update user set openid='%s' where openid='%s'" % query = ("update user set openid=%%:new where openid=%%:old")
(new_openid, old_openid)) conn.execute(query, new=new_openid, old=old_openid)
conn.execute(query.replace('%', '%%'))
# Update all usage of %20 in all openid references using MySQL Replace. # Update all usage of %20 in all openid references using MySQL Replace.
conn.execute("update meta set value = " conn.execute("update meta set value = "

View File

@ -53,7 +53,7 @@ class TestProfileEndpoint(api.FunctionalTest):
url = self.URL + 'pubkeys' url = self.URL + 'pubkeys'
key = rsa.generate_private_key( key = rsa.generate_private_key(
public_exponent=65537, public_exponent=65537,
key_size=1024, key_size=2048,
backend=default_backend() backend=default_backend()
) )
sign = key.sign('signature'.encode('utf-8'), sign = key.sign('signature'.encode('utf-8'),

View File

@ -422,7 +422,7 @@ class TestResultsEndpointNoAnonymous(api.FunctionalTest):
def _generate_keypair_(self): def _generate_keypair_(self):
return rsa.generate_private_key( return rsa.generate_private_key(
public_exponent=65537, public_exponent=65537,
key_size=1024, key_size=2048,
backend=default_backend() backend=default_backend()
) )

View File

@ -109,7 +109,7 @@ class TestResultValidatorTestCase(base.BaseTestCase):
key = rsa.generate_private_key( key = rsa.generate_private_key(
public_exponent=65537, public_exponent=65537,
key_size=1024, key_size=2048,
backend=default_backend() backend=default_backend()
) )
sign = key.sign(request.body, padding.PKCS1v15(), hashes.SHA256()) sign = key.sign(request.body, padding.PKCS1v15(), hashes.SHA256())