Skip to content

Commit

Permalink
Source reply keys should not leak timing information
Browse files Browse the repository at this point in the history
- All source reply keys now have a fixed creation date, which is before
any actual sources were using the platform.
- Source reply keys no longer expire.
  • Loading branch information
garrettr committed Dec 17, 2018
1 parent fbde379 commit b971d0e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion securedrop/crypto_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from random import SystemRandom

from base64 import b32encode
from datetime import date
from flask import current_app
from gnupg._util import _is_stream, _make_binary_stream

Expand Down Expand Up @@ -43,6 +44,11 @@ class CryptoUtil:
GPG_KEY_TYPE = "RSA"
DEFAULT_WORDS_IN_RANDOM_ID = 8

# All reply keypairs will be "created" on the same day SecureDrop (then
# Strongbox) was publicly released for the first time.
# https://www.newyorker.com/news/news-desk/strongbox-and-aaron-swartz
DEFAULT_KEY_CREATION_DATE = date(2013, 5, 14)

def __init__(self,
scrypt_params,
scrypt_id_pepper,
Expand Down Expand Up @@ -170,7 +176,11 @@ def genkeypair(self, name, secret):
key_type=self.GPG_KEY_TYPE,
key_length=self.__gpg_key_length,
passphrase=secret,
name_email=name
name_email=name,
creation_date=self.DEFAULT_KEY_CREATION_DATE.isoformat(),
# "0" is the magic value that tells GPG's batch key generation not
# to set an expiration date.
expire_date="0"
))

def delete_reply_keypair(self, source_filesystem_id):
Expand Down

0 comments on commit b971d0e

Please sign in to comment.