Skip to content

Commit

Permalink
Merge pull request #6011 from freedomofpress/prevent-dup-source-keys
Browse files Browse the repository at this point in the history
Prevent creation of a duplicate source keypair
  • Loading branch information
zenmonkeykstop committed Jun 22, 2021
2 parents 6c9fd2f + 9197446 commit bfed762
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions securedrop/source_app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,7 @@ def submit() -> werkzeug.Response:
db.session.add(submission)
new_submissions.append(submission)

# If necessary, generate a keypair to encrypt replies from the journalist
if g.source.pending or not current_app.crypto_util.get_fingerprint(g.filesystem_id):
current_app.crypto_util.genkeypair(g.filesystem_id, g.codename)
g.source.pending = False

g.source.pending = False
g.source.last_updated = datetime.utcnow()
db.session.commit()

Expand Down

0 comments on commit bfed762

Please sign in to comment.