Lines 379-384
Link Here
|
379 |
|
379 |
|
380 |
/* Now ret is non-NULL, and we own one of its reference counts. */ |
380 |
/* Now ret is non-NULL, and we own one of its reference counts. */ |
381 |
|
381 |
|
|
|
382 |
fprintf(stderr, "CACHE ret-len: %u, s-len: %u\n", ret->sid_ctx_length, s->sid_ctx_length); |
383 |
fprintf(stderr, "CACHE ret-str: %s, s-str: %s\n", ret->sid_ctx, s->sid_ctx); |
384 |
fflush(stderr); |
385 |
|
382 |
if (ret->sid_ctx_length != s->sid_ctx_length |
386 |
if (ret->sid_ctx_length != s->sid_ctx_length |
383 |
|| memcmp(ret->sid_ctx,s->sid_ctx,ret->sid_ctx_length)) |
387 |
|| memcmp(ret->sid_ctx,s->sid_ctx,ret->sid_ctx_length)) |
384 |
{ |
388 |
{ |
Lines 390-395
Link Here
|
390 |
|
394 |
|
391 |
SSLerr(SSL_F_SSL_GET_PREV_SESSION,SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); |
395 |
SSLerr(SSL_F_SSL_GET_PREV_SESSION,SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); |
392 |
#endif |
396 |
#endif |
|
|
397 |
fprintf(stderr, "1\n");fflush(stderr); |
393 |
goto err; /* treat like cache miss */ |
398 |
goto err; /* treat like cache miss */ |
394 |
} |
399 |
} |
395 |
|
400 |
|
Lines 407-420
Link Here
|
407 |
|
412 |
|
408 |
SSLerr(SSL_F_SSL_GET_PREV_SESSION,SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED); |
413 |
SSLerr(SSL_F_SSL_GET_PREV_SESSION,SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED); |
409 |
fatal = 1; |
414 |
fatal = 1; |
|
|
415 |
fprintf(stderr, "2\n");fflush(stderr); |
410 |
goto err; |
416 |
goto err; |
411 |
} |
417 |
} |
412 |
|
418 |
|
|
|
419 |
fprintf(stderr, "3\n"); fflush(stderr); |
413 |
if (ret->cipher == NULL) |
420 |
if (ret->cipher == NULL) |
414 |
{ |
421 |
{ |
415 |
unsigned char buf[5],*p; |
422 |
unsigned char buf[5],*p; |
416 |
unsigned long l; |
423 |
unsigned long l; |
417 |
|
424 |
|
|
|
425 |
fprintf(stderr, "4\n");fflush(stderr); |
418 |
p=buf; |
426 |
p=buf; |
419 |
l=ret->cipher_id; |
427 |
l=ret->cipher_id; |
420 |
l2n(l,p); |
428 |
l2n(l,p); |
Lines 436-443
Link Here
|
436 |
CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION); |
444 |
CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION); |
437 |
#endif |
445 |
#endif |
438 |
|
446 |
|
|
|
447 |
|
448 |
fprintf(stderr, "5\n"); fflush(stderr); |
439 |
if (ret->timeout < (long)(time(NULL) - ret->time)) /* timeout */ |
449 |
if (ret->timeout < (long)(time(NULL) - ret->time)) /* timeout */ |
440 |
{ |
450 |
{ |
|
|
451 |
fprintf(stderr, "6\n"); fflush(stderr); |
441 |
s->ctx->stats.sess_timeout++; |
452 |
s->ctx->stats.sess_timeout++; |
442 |
/* remove it from the cache */ |
453 |
/* remove it from the cache */ |
443 |
SSL_CTX_remove_session(s->ctx,ret); |
454 |
SSL_CTX_remove_session(s->ctx,ret); |
Lines 450-455
Link Here
|
450 |
/* again, just leave the session |
461 |
/* again, just leave the session |
451 |
* if it is the same session, we have just incremented and |
462 |
* if it is the same session, we have just incremented and |
452 |
* then decremented the reference count :-) */ |
463 |
* then decremented the reference count :-) */ |
|
|
464 |
fprintf(stderr, "7\n"); fflush(stderr); |
453 |
if (s->session != NULL) |
465 |
if (s->session != NULL) |
454 |
SSL_SESSION_free(s->session); |
466 |
SSL_SESSION_free(s->session); |
455 |
s->session=ret; |
467 |
s->session=ret; |
Lines 457-468
Link Here
|
457 |
return(1); |
469 |
return(1); |
458 |
|
470 |
|
459 |
err: |
471 |
err: |
|
|
472 |
fprintf(stderr, "8\n"); fflush(stderr); |
460 |
if (ret != NULL) |
473 |
if (ret != NULL) |
461 |
SSL_SESSION_free(ret); |
474 |
SSL_SESSION_free(ret); |
462 |
if (fatal) |
475 |
if (fatal) { |
|
|
476 |
fprintf(stderr, "9\n"); fflush(stderr); |
463 |
return -1; |
477 |
return -1; |
464 |
else |
478 |
} |
|
|
479 |
else { |
480 |
fprintf(stderr, "10\n");fflush(stderr); |
465 |
return 0; |
481 |
return 0; |
|
|
482 |
} |
466 |
} |
483 |
} |
467 |
|
484 |
|
468 |
int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c) |
485 |
int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c) |