• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/Security-57031.1.35/Security/libsecurity_ssl/Security/

Lines Matching refs:entry

45  * When a session is added via sslAddSession, and a cache entry already
47 * cache entry is updated with the new sessionData. The entry's expiration
48 * time is unchanged (thus a given session entry can only be used for a finite
76 const void *entry,
80 printf("entry: %p ", entry);
107 * One entry (value) in SessionCache.
117 /* this entry to be removed from session map at this time */
137 SessionCacheEntry *entry = sslMalloc(sizeof(SessionCacheEntry));
138 if (entry == NULL)
141 serr = SSLCopyBuffer(key, &entry->mKey);
143 sslFree (entry);
146 serr = SSLCopyBuffer(sessionData, &entry->mSessionData);
148 SSLFreeBuffer(&entry->mKey);
149 sslFree (entry);
153 sslLogSessCacheDebug("SessionCacheEntryCreate(buf,buf) %p", entry);
154 entry->mExpiration = expirationTime;
156 return entry;
159 static void SessionCacheEntryDelete(SessionCacheEntry *entry)
161 sslLogSessCacheDebug("~SessionCacheEntryDelete() %p", entry);
162 SSLFreeBuffer(&entry->mKey); // no SSLContext
163 SSLFreeBuffer(&entry->mSessionData);
164 sslFree(entry);
168 static bool SessionCacheEntryMatchKey(SessionCacheEntry *entry,
171 if(key->length != entry->mKey.length) {
174 if((key->data == NULL) || (entry->mKey.data == NULL)) {
177 return (memcmp(key->data, entry->mKey.data, entry->mKey.length) == 0);
180 static bool SessionCacheEntryIsStale(SessionCacheEntry *entry,
183 return now > entry->mExpiration;
187 static bool SessionCacheEntryIsStaleNow(SessionCacheEntry *entry)
189 return SessionCacheEntryIsStale(entry, CFAbsoluteTimeGetCurrent());
193 static OSStatus SessionCacheEntrySetSessionData(SessionCacheEntry *entry,
196 SSLFreeBuffer(&entry->mSessionData);
197 return SSLCopyBuffer(data, &entry->mSessionData);
236 SessionCacheEntry *entry = NULL;
241 entry = *current;
242 if (SessionCacheEntryMatchKey(entry, sessionKey)) {
243 /* cache hit - just update this entry's sessionData if necessary */
246 /* What if the entry has already expired? */
247 if((entry->mSessionData.length == sessionData->length) &&
248 (memcmp(entry->mSessionData.data, sessionData->data,
255 "entry = %p", entry);
260 "entry = %p", entry);
261 return SessionCacheEntrySetSessionData(entry, sessionData);
276 entry = SessionCacheEntryCreate(sessionKey, sessionData, expireTime);
278 sslLogSessCacheDebug("SessionCache::addEntry %p", entry);
279 cachePrint(entry, sessionKey, sessionData);
283 entry->next = cache->head;
284 cache->head = entry;
294 SessionCacheEntry *entry = NULL;
297 entry = *current;
298 if (SessionCacheEntryMatchKey(entry, sessionKey))
305 if (SessionCacheEntryIsStaleNow(entry)) {
307 "entry, deleting; current %p, entry->next %p",
308 entry, current, entry->next);
309 cachePrint(entry, sessionKey, &entry->mSessionData);
310 *current = entry->next;
311 SessionCacheEntryDelete(entry);
315 /* alloc/copy sessionData from existing entry (caller must free) */
316 return SSLCopyBuffer(&entry->mSessionData, sessionData);
326 SessionCacheEntry *entry = *current;
327 if (SessionCacheEntryMatchKey(entry, sessionKey)) {
330 "cached session (%p)", entry);
331 cachePrint(entry, &entry->mKey, &entry->mSessionData);
333 *current = entry->next;
334 SessionCacheEntryDelete(entry);
350 SessionCacheEntry *entry = *current;
351 if(SessionCacheEntryIsStale(entry, rightNow)) {
354 "cached session (%p)", entry);
355 cachePrint(entry, &entry->mKey, &entry->mSessionData);
357 *current = entry->next;
358 SessionCacheEntryDelete(entry);
373 SessionCacheEntry *entry;
376 for(entry = cache->head; entry; entry = entry->next) {
377 cachePrint(entry, &entry->mKey, &entry->mSessionData);