mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
it's amazing what a bit of punctuation can do for appearances
svn:r1843
This commit is contained in:
+4
-4
@@ -172,7 +172,7 @@ crypto_pk_env_t *_crypto_new_pk_env_rsa(RSA *rsa)
|
||||
return env;
|
||||
}
|
||||
|
||||
/** used by tortls.c: return the RSA* from a crypto_pk_env_t */
|
||||
/** used by tortls.c: return the RSA* from a crypto_pk_env_t. */
|
||||
RSA *_crypto_pk_env_get_rsa(crypto_pk_env_t *env)
|
||||
{
|
||||
return env->key;
|
||||
@@ -1062,9 +1062,9 @@ crypto_digest_assign(crypto_digest_env_t *into,
|
||||
|
||||
/* DH */
|
||||
|
||||
/** Shared P parameter for our DH key exchanged */
|
||||
/** Shared P parameter for our DH key exchanged. */
|
||||
static BIGNUM *dh_param_p = NULL;
|
||||
/** Shared G parameter for our DH key exchanges */
|
||||
/** Shared G parameter for our DH key exchanges. */
|
||||
static BIGNUM *dh_param_g = NULL;
|
||||
|
||||
/** Initialize dh_param_p and dh_param_g if they are not already
|
||||
@@ -1332,7 +1332,7 @@ void crypto_pseudo_rand(unsigned int n, unsigned char *to)
|
||||
}
|
||||
|
||||
/** Return a pseudorandom integer, choosen uniformly from the values
|
||||
* between 0 and max-1 */
|
||||
* between 0 and max-1. */
|
||||
int crypto_pseudo_rand_int(unsigned int max) {
|
||||
unsigned int val;
|
||||
unsigned int cutoff;
|
||||
|
||||
+8
-8
@@ -23,15 +23,15 @@
|
||||
|
||||
/** Information for a single logfile; only used in log.c */
|
||||
typedef struct logfile_t {
|
||||
struct logfile_t *next; /**< Next logfile_t in the linked list */
|
||||
const char *filename; /**< Filename to open */
|
||||
FILE *file; /**< Stream to receive log messages */
|
||||
struct logfile_t *next; /**< Next logfile_t in the linked list. */
|
||||
const char *filename; /**< Filename to open. */
|
||||
FILE *file; /**< Stream to receive log messages. */
|
||||
int needs_close; /**< Boolean: true if the stream gets closed on shutdown. */
|
||||
int loglevel; /**< Lowest severity level to send to this stream. */
|
||||
int max_loglevel; /**< Highest severity level to send to this stream. */
|
||||
} logfile_t;
|
||||
|
||||
/** Helper: map a log severity to descriptive string */
|
||||
/** Helper: map a log severity to descriptive string. */
|
||||
static INLINE const char *sev_to_string(int severity) {
|
||||
switch(severity) {
|
||||
case LOG_DEBUG: return "debug";
|
||||
@@ -43,7 +43,7 @@ static INLINE const char *sev_to_string(int severity) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Linked list of logfile_t */
|
||||
/** Linked list of logfile_t. */
|
||||
static logfile_t *logfiles = NULL;
|
||||
|
||||
/** Helper: Format a log message into a fixed-sized buffer. (This is
|
||||
@@ -126,7 +126,7 @@ void _log(int severity, const char *format, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
/** Output a message to the log, prefixed with a function name <b>fn</b> */
|
||||
/** Output a message to the log, prefixed with a function name <b>fn</b>. */
|
||||
void _log_fn(int severity, const char *fn, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
@@ -135,7 +135,7 @@ void _log_fn(int severity, const char *fn, const char *format, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
/** Close all open log files */
|
||||
/** Close all open log files. */
|
||||
void close_logs()
|
||||
{
|
||||
logfile_t *victim;
|
||||
@@ -178,7 +178,7 @@ void add_stream_log(int loglevel, const char *name, FILE *stream)
|
||||
/**
|
||||
* Add a log handler to send messages to <b>filename</b>. If opening
|
||||
* the logfile fails, -1 is returned and errno is set appropriately
|
||||
* (by fopen)
|
||||
* (by fopen).
|
||||
*/
|
||||
int add_file_log(int loglevel, const char *filename)
|
||||
{
|
||||
|
||||
+5
-5
@@ -38,18 +38,18 @@ typedef struct tor_tls_context_st {
|
||||
} tor_tls_context;
|
||||
|
||||
/** Holds a SSL object and its associated data. Members are only
|
||||
* accessed from within tortls.c
|
||||
* accessed from within tortls.c.
|
||||
*/
|
||||
struct tor_tls_st {
|
||||
SSL *ssl; /**< An OpenSSL SSL object */
|
||||
int socket; /**< The underlying file descriptor for this TLS connection */
|
||||
SSL *ssl; /**< An OpenSSL SSL object. */
|
||||
int socket; /**< The underlying file descriptor for this TLS connection. */
|
||||
enum {
|
||||
TOR_TLS_ST_HANDSHAKE, TOR_TLS_ST_OPEN, TOR_TLS_ST_GOTCLOSE,
|
||||
TOR_TLS_ST_SENTCLOSE, TOR_TLS_ST_CLOSED
|
||||
} state; /**< The current SSL state, depending on which operations have
|
||||
* completed successfully. */
|
||||
int isServer;
|
||||
int wantwrite_n; /**< 0 normally, >0 if we returned wantwrite last time */
|
||||
int wantwrite_n; /**< 0 normally, >0 if we returned wantwrite last time. */
|
||||
};
|
||||
|
||||
static X509* tor_tls_create_certificate(crypto_pk_env_t *rsa,
|
||||
@@ -59,7 +59,7 @@ static X509* tor_tls_create_certificate(crypto_pk_env_t *rsa,
|
||||
unsigned int lifetime);
|
||||
|
||||
/** Global tls context. We keep it here because nobody else needs to
|
||||
* touch it */
|
||||
* touch it. */
|
||||
static tor_tls_context *global_tls_context = NULL;
|
||||
/** True iff tor_tls_init() has been called. */
|
||||
static int tls_library_is_initialized = 0;
|
||||
|
||||
Reference in New Issue
Block a user