Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 674606
Collapse All | Expand All

(-)sslsniff/SessionCache.cpp (-3 / +5 lines)
Lines 47-53 void SessionCache::removeSessionId(unsig Link Here
47
}
47
}
48
48
49
int SessionCache::setNewSessionId(SSL *s, SSL_SESSION *session) {
49
int SessionCache::setNewSessionId(SSL *s, SSL_SESSION *session) {
50
  return setNewSessionId(s, session, session->session_id, session->session_id_length);
50
  unsigned int id_length;
51
  const unsigned char *id = SSL_SESSION_get_id(session, &id_length);
52
  return setNewSessionId(s, session, (unsigned char*)id, id_length);
51
}
53
}
52
54
53
int SessionCache::setNewSessionId(SSL *s, SSL_SESSION *session, 
55
int SessionCache::setNewSessionId(SSL *s, SSL_SESSION *session, 
Lines 94-100 int SessionCache::setNewSessionId(SSL *s Link Here
94
  return 1;  
96
  return 1;  
95
}
97
}
96
98
97
SSL_SESSION * SessionCache::getSessionId(SSL *s, unsigned char *id, int idLength, int *ref) {
99
SSL_SESSION * SessionCache::getSessionId(SSL *s, const unsigned char *id, int idLength, int *ref) {
98
  int i;
100
  int i;
99
  unsigned char *b;
101
  unsigned char *b;
100
102
Lines 117-123 SSL_SESSION * SessionCache::getSessionId Link Here
117
119
118
// Trampoline Functions.  Yay C.
120
// Trampoline Functions.  Yay C.
119
121
120
SSL_SESSION * SessionCache::getSessionIdTramp(SSL *s, unsigned char *id, int idLength, int *ref) {
122
SSL_SESSION * SessionCache::getSessionIdTramp(SSL *s, const unsigned char *id, int idLength, int *ref) {
121
  return SessionCache::getInstance()->getSessionId(s, id, idLength, ref);
123
  return SessionCache::getInstance()->getSessionId(s, id, idLength, ref);
122
}
124
}
123
125
(-)sslsniff/certificate/Certificate.hpp (-1 / +2 lines)
Lines 92-98 private: Link Here
92
  }
92
  }
93
93
94
  void parseCommonName(X509 *cert) {
94
  void parseCommonName(X509 *cert) {
95
    std::string distinguishedName(cert->name);
95
    char buf[4096];
96
    std::string distinguishedName(X509_NAME_oneline(X509_get_subject_name(cert), buf, sizeof(buf)));
96
    std::string::size_type cnIndex = distinguishedName.find("CN=");
97
    std::string::size_type cnIndex = distinguishedName.find("CN=");
97
98
98
    if (cnIndex == std::string::npos) throw BadCertificateException();
99
    if (cnIndex == std::string::npos) throw BadCertificateException();
(-)sslsniff/certificate/TargetedCertificateManager.cpp (-1 / +2 lines)
Lines 115-122 void TargetedCertificateManager::getCert Link Here
115
115
116
void TargetedCertificateManager::dump() {
116
void TargetedCertificateManager::dump() {
117
  std::list<Certificate*>::iterator i;
117
  std::list<Certificate*>::iterator i;
118
  char buf[4096];
118
119
119
  for(i=certificates.begin(); i != certificates.end(); ++i) 
120
  for(i=certificates.begin(); i != certificates.end(); ++i) 
120
    std::cout << "Certificate: " << (*i)->getCert()->name << std::endl;
121
    std::cout << "Certificate: " << X509_NAME_oneline(X509_get_subject_name((*i)->getCert()), buf, sizeof(buf)) << std::endl;
121
122
122
}
123
}
(-)sslsniff/SessionCache.hpp (-2 / +2 lines)
Lines 49-60 class SessionCache { Link Here
49
49
50
public:
50
public:
51
  static SessionCache* getInstance();
51
  static SessionCache* getInstance();
52
  static SSL_SESSION * getSessionIdTramp(SSL *s, unsigned char *id, int idLength, int *ref);
52
  static SSL_SESSION * getSessionIdTramp(SSL *s, const unsigned char *id, int idLength, int *ref);
53
  static int setNewSessionIdTramp(SSL *s, SSL_SESSION *session);
53
  static int setNewSessionIdTramp(SSL *s, SSL_SESSION *session);
54
54
55
  int setNewSessionId(SSL *s, SSL_SESSION *session);
55
  int setNewSessionId(SSL *s, SSL_SESSION *session);
56
  int setNewSessionId(SSL *s, SSL_SESSION *session, unsigned char *id, int idLength);
56
  int setNewSessionId(SSL *s, SSL_SESSION *session, unsigned char *id, int idLength);
57
  SSL_SESSION * getSessionId(SSL *s, unsigned char *id, int idLength, int *ref);
57
  SSL_SESSION * getSessionId(SSL *s, const unsigned char *id, int idLength, int *ref);
58
58
59
private:
59
private:
60
  static SessionCache *sessionCache;
60
  static SessionCache *sessionCache;

Return to bug 674606