oh, and some more in common/

svn:r2483
This commit is contained in:
Roger Dingledine 2004-10-14 02:48:57 +00:00
parent aebc3a03ba
commit 5f4a390b33
3 changed files with 8 additions and 8 deletions

View File

@ -50,7 +50,7 @@ struct tor_tls_st {
} state; /**< The current SSL state, depending on which operations have } state; /**< The current SSL state, depending on which operations have
* completed successfully. */ * completed successfully. */
int isServer; int isServer;
int wantwrite_n; /**< 0 normally, >0 if we returned wantwrite last time. */ size_t wantwrite_n; /**< 0 normally, >0 if we returned wantwrite last time. */
}; };
static X509* tor_tls_create_certificate(crypto_pk_env_t *rsa, static X509* tor_tls_create_certificate(crypto_pk_env_t *rsa,
@ -429,7 +429,7 @@ tor_tls_free(tor_tls *tls)
* TOR_TLS_CLOSE, TOR_TLS_WANTREAD, or TOR_TLS_WANTWRITE. * TOR_TLS_CLOSE, TOR_TLS_WANTREAD, or TOR_TLS_WANTWRITE.
*/ */
int int
tor_tls_read(tor_tls *tls, char *cp, int len) tor_tls_read(tor_tls *tls, char *cp, size_t len)
{ {
int r, err; int r, err;
tor_assert(tls && tls->ssl); tor_assert(tls && tls->ssl);
@ -454,7 +454,7 @@ tor_tls_read(tor_tls *tls, char *cp, int len)
* TOR_TLS_WANTREAD, or TOR_TLS_WANTWRITE. * TOR_TLS_WANTREAD, or TOR_TLS_WANTWRITE.
*/ */
int int
tor_tls_write(tor_tls *tls, char *cp, int n) tor_tls_write(tor_tls *tls, char *cp, size_t n)
{ {
int r, err; int r, err;
tor_assert(tls && tls->ssl); tor_assert(tls && tls->ssl);
@ -580,7 +580,7 @@ tor_tls_peer_has_cert(tor_tls *tls)
* claims to have. * claims to have.
*/ */
int int
tor_tls_get_peer_cert_nickname(tor_tls *tls, char *buf, int buflen) tor_tls_get_peer_cert_nickname(tor_tls *tls, char *buf, size_t buflen)
{ {
X509 *cert = NULL; X509 *cert = NULL;
X509_NAME *name = NULL; X509_NAME *name = NULL;

View File

@ -27,10 +27,10 @@ int tor_tls_context_new(crypto_pk_env_t *rsa, int isServer,
tor_tls *tor_tls_new(int sock, int is_server, int use_no_cert); tor_tls *tor_tls_new(int sock, int is_server, int use_no_cert);
void tor_tls_free(tor_tls *tls); void tor_tls_free(tor_tls *tls);
int tor_tls_peer_has_cert(tor_tls *tls); int tor_tls_peer_has_cert(tor_tls *tls);
int tor_tls_get_peer_cert_nickname(tor_tls *tls, char *buf, int buflen); int tor_tls_get_peer_cert_nickname(tor_tls *tls, char *buf, size_t buflen);
int tor_tls_verify(tor_tls *tls, crypto_pk_env_t **identity); int tor_tls_verify(tor_tls *tls, crypto_pk_env_t **identity);
int tor_tls_read(tor_tls *tls, char *cp, int len); int tor_tls_read(tor_tls *tls, char *cp, size_t len);
int tor_tls_write(tor_tls *tls, char *cp, int n); int tor_tls_write(tor_tls *tls, char *cp, size_t n);
int tor_tls_handshake(tor_tls *tls); int tor_tls_handshake(tor_tls *tls);
int tor_tls_shutdown(tor_tls *tls); int tor_tls_shutdown(tor_tls *tls);
int tor_tls_get_pending_bytes(tor_tls *tls); int tor_tls_get_pending_bytes(tor_tls *tls);

View File

@ -1650,7 +1650,7 @@ char *read_file_to_str(const char *filename, int bin) {
* that is whitespace or comment. * that is whitespace or comment.
* Return 1 if success, 0 if no more lines, -1 if error. * Return 1 if success, 0 if no more lines, -1 if error.
*/ */
int parse_line_from_file(char *line, int maxlen, FILE *f, char **key_out, char **value_out) { int parse_line_from_file(char *line, size_t maxlen, FILE *f, char **key_out, char **value_out) {
char *s, *key, *end, *value; char *s, *key, *end, *value;
try_next_line: try_next_line: