Skip to content

Commit

Permalink
Bug 1654332 - Fixup a10493dcfcc9: copy ECHConfig.config_id with socke…
Browse files Browse the repository at this point in the history
…t r=jcj

A late review change for ECH was for the server to compute each ECHConfig `config_id` when set to the socket, rather than on each connection. This works, but now we also need to copy that config_id when copying a socket, else the server won't find a matching ECHConfig to use for decryption.

Differential Revision: https://phabricator.services.mozilla.com/D97475

--HG--
extra : moz-landing-system : lando
  • Loading branch information
Kevin Jacobs committed Nov 18, 2020
1 parent 4516d10 commit 8010b1a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ssl/ssl3con.c
Expand Up @@ -5521,7 +5521,7 @@ ssl3_SendClientHello(sslSocket *ss, sslClientHelloType type)
if (IS_DTLS(ss)) {
rv = dtls_StageHandshakeMessage(ss);
if (rv != SECSuccess) {
return rv;
goto loser;
}
}
/* By default, all messagess are added to both the inner and
Expand Down
2 changes: 1 addition & 1 deletion lib/ssl/tls13con.c
Expand Up @@ -1752,7 +1752,7 @@ tls13_MaybeSendHelloRetry(sslSocket *ss, const sslNamedGroupDef *requestedGroup,
return SECFailure; /* Code already set. */
}

/* We received ECH, but have to start over with CH2. */
/* We may have received ECH, but have to start over with CH2. */
ss->ssl3.hs.echAccepted = PR_FALSE;
PK11_HPKE_DestroyContext(ss->ssl3.hs.echHpkeCtx, PR_TRUE);
ss->ssl3.hs.echHpkeCtx = NULL;
Expand Down
1 change: 1 addition & 0 deletions lib/ssl/tls13ech.c
Expand Up @@ -86,6 +86,7 @@ tls13_CopyEchConfigs(PRCList *oConfigs, PRCList *configs)
newConfig->contents.kdfId = config->contents.kdfId;
newConfig->contents.aeadId = config->contents.aeadId;
newConfig->contents.maxNameLen = config->contents.maxNameLen;
PORT_Memcpy(newConfig->configId, config->configId, sizeof(newConfig->configId));
PR_APPEND_LINK(&newConfig->link, configs);
}
return SECSuccess;
Expand Down

0 comments on commit 8010b1a

Please sign in to comment.