23 #ifndef SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 77 static int callback(SSL* ssl,
unsigned char* keyName,
79 EVP_CIPHER_CTX* cipherCtx,
80 HMAC_CTX* hmacCtx,
int encrypt);
91 bool setTLSTicketKeySeeds(
const std::vector<std::string>& oldSeeds,
92 const std::vector<std::string>& currentSeeds,
93 const std::vector<std::string>& newSeeds);
95 bool getTLSTicketKeySeeds(std::vector<std::string>& oldSeeds,
96 std::vector<std::string>& currentSeeds,
97 std::vector<std::string>& newSeeds)
const;
101 int processTicket(SSL* ssl,
104 EVP_CIPHER_CTX* cipherCtx,
107 return CHECK_NOTNULL(obj)
108 ->processTicket(ssl, keyName, iv, cipherCtx, hmacCtx, encrypt);
112 Unsafe unsafe() {
return Unsafe{
this}; }
115 enum TLSTicketSeedType {
122 struct TLSTicketSeed {
124 TLSTicketSeedType
type_;
125 unsigned char seedName_[SHA256_DIGEST_LENGTH];
128 struct TLSTicketKeySource {
131 TLSTicketSeedType
type_;
132 unsigned char keySource_[SHA256_DIGEST_LENGTH];
152 int processTicket(SSL* ssl,
unsigned char* keyName,
154 EVP_CIPHER_CTX* cipherCtx,
155 HMAC_CTX* hmacCtx,
int encrypt);
159 unsigned char* nameBuf);
166 TLSTicketKeySource* insertNewKey(TLSTicketSeed* seed,
uint32_t hashCount,
167 TLSTicketKeySource* prevKeySource);
173 void hashNth(
const unsigned char* input,
size_t input_len,
179 TLSTicketSeed* insertSeed(
const std::string& seedInput,
180 TLSTicketSeedType
type);
185 TLSTicketKeySource* findEncryptionKey();
190 TLSTicketKeySource* findDecryptionKey(
unsigned char* keyName);
195 void recordTlsTicketRotation(
196 const std::vector<std::string>& oldSeeds,
197 const std::vector<std::string>& currentSeeds,
198 const std::vector<std::string>& newSeeds);
203 void makeUniqueKeys(
unsigned char* parentKey,
size_t keyLen,
204 unsigned char* salt,
unsigned char* output);
206 typedef std::vector<std::unique_ptr<TLSTicketSeed>> TLSTicketSeedList;
207 typedef std::map<std::string, std::unique_ptr<TLSTicketKeySource> >
209 typedef std::vector<TLSTicketKeySource *> TLSActiveKeyList;
211 TLSTicketSeedList ticketSeeds_;
213 TLSTicketKeyMap ticketKeys_;
215 TLSActiveKeyList activeKeys_;
std::shared_ptr< FizzServerContext > ctx_