1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-26 07:41:33 +03:00

work towards one request per session

This commit is contained in:
Seth Schoen
2012-06-27 17:16:07 -07:00
parent abb4673fd8
commit 6d3ca7c94c
2 changed files with 12 additions and 16 deletions

View File

@@ -67,16 +67,13 @@ message chocolatemessage {
required string certificate = 1; /* Repeated string certificate? */
}
repeated SigningRequest request = 3; /* TODO or should there just be one request and the request
should use subject alternate names for every name that
we want to have signed? There could still be multiple
optional SigningRequest request = 3; /* There should just be one request and the request
must use subject alternate names for every name that
we want to have signed. There could still be multiple
challenges in response -- one or more challenges per
name. */
optional Failure failure = 4; /* TODO need to think about where there can be multiple failures
reported at once, and whether all failures are completely fatal
to the protocol, requiring it to be restarted from the beginning,
or whether you could have some CSRs fail and others still
succeed. */
optional Failure failure = 4; /* Each failure is completely fatal to the protocol, requiring it
to be restarted from the beginning. */
optional Proceed proceed = 5;
repeated Challenge challenge = 6;
repeated Challenge completedchallenge = 7;

View File

@@ -26,15 +26,14 @@ def init(m):
m.session = ""
def make_request(m):
m.request.add()
m.request[0].nonce = "".join([random.choice("abcdefghijklmnopqrstuvwxyz") for i in xrange(20)])
m.request[0].recipient = "ca.example.com"
m.request[0].timestamp = int(time.time())
m.request[0].csr = "FOO"
m.request[0].sig = "BAR"
m.request.nonce = "".join([random.choice("abcdefghijklmnopqrstuvwxyz") for i in xrange(20)])
m.request.recipient = "ca.example.com"
m.request.timestamp = int(time.time())
m.request.csr = "FOO"
m.request.sig = "BAR"
def sign(k, m, i=0):
m.request[i].sig = CSR.sign(k, sha256("(%d) (%s) (%s) (%s)" % (m.request[i].timestamp, m.request[i].recipient, m.request[i].nonce, m.request[i].csr)))
def sign(k, m):
m.request.sig = CSR.sign(k, sha256("(%d) (%s) (%s) (%s)" % (m.request.timestamp, m.request.recipient, m.request.nonce, m.request.csr)))
m = chocolatemessage()