libssl_internals.c (nss-3.61) | : | libssl_internals.c (nss-3.62) | ||
---|---|---|---|---|
skipping to change at line 497 | skipping to change at line 497 | |||
SECStatus SSLInt_SetRawEchConfigForRetry(PRFileDesc *fd, const uint8_t *buf, | SECStatus SSLInt_SetRawEchConfigForRetry(PRFileDesc *fd, const uint8_t *buf, | |||
size_t len) { | size_t len) { | |||
sslSocket *ss = ssl_FindSocket(fd); | sslSocket *ss = ssl_FindSocket(fd); | |||
if (!ss) { | if (!ss) { | |||
return SECFailure; | return SECFailure; | |||
} | } | |||
sslEchConfig *cfg = (sslEchConfig *)PR_LIST_HEAD(&ss->echConfigs); | sslEchConfig *cfg = (sslEchConfig *)PR_LIST_HEAD(&ss->echConfigs); | |||
SECITEM_FreeItem(&cfg->raw, PR_FALSE); | SECITEM_FreeItem(&cfg->raw, PR_FALSE); | |||
SECITEM_AllocItem(NULL, &cfg->raw, len); | SECITEM_AllocItem(NULL, &cfg->raw, len); | |||
memcpy(cfg->raw.data, buf, len); | PORT_Memcpy(cfg->raw.data, buf, len); | |||
return SECSuccess; | ||||
} | ||||
// Zero the echConfig.config_id for all configured echConfigs. | ||||
// This mimics a collision on the 8B config ID so that we can | ||||
// test trial decryption. | ||||
SECStatus SSLInt_ZeroEchConfigIds(PRFileDesc *fd) { | ||||
if (!fd) { | ||||
return SECFailure; | ||||
} | ||||
sslSocket *ss = ssl_FindSocket(fd); | ||||
if (!ss) { | ||||
return SECFailure; | ||||
} | ||||
for (PRCList *cur_p = PR_LIST_HEAD(&ss->echConfigs); cur_p != &ss->echConfigs; | ||||
cur_p = PR_NEXT_LINK(cur_p)) { | ||||
PORT_Memset(((sslEchConfig *)cur_p)->configId, 0, | ||||
sizeof(((sslEchConfig *)cur_p)->configId)); | ||||
} | ||||
return SECSuccess; | return SECSuccess; | |||
} | } | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 22 lines changed or added |