19 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
20 |
|
* USA |
21 |
|
* |
22 |
< |
* $Id: s_misc.c,v 7.37 2005/09/11 11:31:43 michael Exp $ |
22 |
> |
* $Id$ |
23 |
|
*/ |
24 |
|
|
25 |
|
#include "stdinc.h" |
115 |
|
return buf; |
116 |
|
} |
117 |
|
|
118 |
– |
/* small_file_date() |
119 |
– |
* Make a small YYYYMMDD formatted string suitable for a |
120 |
– |
* dated file stamp. |
121 |
– |
*/ |
122 |
– |
char * |
123 |
– |
small_file_date(time_t lclock) |
124 |
– |
{ |
125 |
– |
static char timebuffer[MAX_DATE_STRING]; |
126 |
– |
struct tm *tmptr; |
127 |
– |
|
128 |
– |
if (!lclock) |
129 |
– |
time(&lclock); |
130 |
– |
|
131 |
– |
tmptr = localtime(&lclock); |
132 |
– |
strftime(timebuffer, MAX_DATE_STRING, "%Y%m%d", tmptr); |
133 |
– |
|
134 |
– |
return timebuffer; |
135 |
– |
} |
136 |
– |
|
118 |
|
#ifdef HAVE_LIBCRYPTO |
119 |
|
char * |
120 |
< |
ssl_get_cipher(SSL *ssl) |
120 |
> |
ssl_get_cipher(const SSL *ssl) |
121 |
|
{ |
122 |
< |
static char buffer[128]; |
123 |
< |
const char *name = NULL; |
143 |
< |
int bits; |
144 |
< |
|
145 |
< |
switch (ssl->session->ssl_version) |
146 |
< |
{ |
147 |
< |
case SSL2_VERSION: |
148 |
< |
name = "SSLv2"; |
149 |
< |
break; |
150 |
< |
|
151 |
< |
case SSL3_VERSION: |
152 |
< |
name = "SSLv3"; |
153 |
< |
break; |
154 |
< |
|
155 |
< |
case TLS1_VERSION: |
156 |
< |
name = "TLSv1"; |
157 |
< |
break; |
158 |
< |
|
159 |
< |
default: |
160 |
< |
name = "UNKNOWN"; |
161 |
< |
} |
122 |
> |
static char buffer[IRCD_BUFSIZE / 4]; |
123 |
> |
int bits = 0; |
124 |
|
|
125 |
|
SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), &bits); |
126 |
|
|
127 |
< |
snprintf(buffer, sizeof(buffer), "%s %s-%d", |
128 |
< |
name, SSL_get_cipher(ssl), bits); |
127 |
> |
snprintf(buffer, sizeof(buffer), "%s %s-%d", SSL_get_version(ssl), |
128 |
> |
SSL_get_cipher(ssl), bits); |
129 |
|
|
130 |
|
return buffer; |
131 |
|
} |