mirror of
https://github.com/certbot/certbot.git
synced 2026-07-30 18:04:31 +02:00
work towards one request per session
This commit is contained in:
@@ -67,16 +67,13 @@ message chocolatemessage {
|
|||||||
required string certificate = 1; /* Repeated string certificate? */
|
required string certificate = 1; /* Repeated string certificate? */
|
||||||
}
|
}
|
||||||
|
|
||||||
repeated SigningRequest request = 3; /* TODO or should there just be one request and the request
|
optional SigningRequest request = 3; /* There should just be one request and the request
|
||||||
should use subject alternate names for every name that
|
must use subject alternate names for every name that
|
||||||
we want to have signed? There could still be multiple
|
we want to have signed. There could still be multiple
|
||||||
challenges in response -- one or more challenges per
|
challenges in response -- one or more challenges per
|
||||||
name. */
|
name. */
|
||||||
optional Failure failure = 4; /* TODO need to think about where there can be multiple failures
|
optional Failure failure = 4; /* Each failure is completely fatal to the protocol, requiring it
|
||||||
reported at once, and whether all failures are completely fatal
|
to be restarted from the beginning. */
|
||||||
to the protocol, requiring it to be restarted from the beginning,
|
|
||||||
or whether you could have some CSRs fail and others still
|
|
||||||
succeed. */
|
|
||||||
optional Proceed proceed = 5;
|
optional Proceed proceed = 5;
|
||||||
repeated Challenge challenge = 6;
|
repeated Challenge challenge = 6;
|
||||||
repeated Challenge completedchallenge = 7;
|
repeated Challenge completedchallenge = 7;
|
||||||
|
|||||||
+7
-8
@@ -26,15 +26,14 @@ def init(m):
|
|||||||
m.session = ""
|
m.session = ""
|
||||||
|
|
||||||
def make_request(m):
|
def make_request(m):
|
||||||
m.request.add()
|
m.request.nonce = "".join([random.choice("abcdefghijklmnopqrstuvwxyz") for i in xrange(20)])
|
||||||
m.request[0].nonce = "".join([random.choice("abcdefghijklmnopqrstuvwxyz") for i in xrange(20)])
|
m.request.recipient = "ca.example.com"
|
||||||
m.request[0].recipient = "ca.example.com"
|
m.request.timestamp = int(time.time())
|
||||||
m.request[0].timestamp = int(time.time())
|
m.request.csr = "FOO"
|
||||||
m.request[0].csr = "FOO"
|
m.request.sig = "BAR"
|
||||||
m.request[0].sig = "BAR"
|
|
||||||
|
|
||||||
def sign(k, m, i=0):
|
def sign(k, m):
|
||||||
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)))
|
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()
|
m = chocolatemessage()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user