/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
if (c == NULL) {
c = silc_calloc(5, sizeof(*c));
- if (!c)
- return 0;
cache_count = 5;
}
if (i == cache_count) {
c = silc_realloc(c, sizeof(*c) * (cache_count + 5));
- if (!c)
- return cache_count;
for (i = cache_count; i < cache_count + 5; i++) {
c[i].data = NULL;
c[i].id = NULL;
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/* Allocate new SilcBuffer */
sb = silc_calloc(1, sizeof(*sb));
- if (!sb)
- return NULL;
/* Allocate the actual data area */
- data = silc_malloc(len);
- if (!data)
- return NULL;
+ data = silc_calloc(len, sizeof(*data));
memset(data, 0, len);
/* Set pointers to the new buffer */
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
SILC_LOG_DEBUG(("Parsing channel payload"));
new = silc_calloc(1, sizeof(*new));
- if (!new) {
- SILC_LOG_ERROR(("Could not allocate new channel payload"));
- return NULL;
- }
/* Parse the Channel Payload. Ignore padding and IV, we don't need
them. */
/* Allocate channel payload buffer */
len += pad_len;
buffer = silc_buffer_alloc(len + iv_len);
- if (!buffer)
- return NULL;
/* Generate padding */
for (i = 0; i < pad_len; i++)
SILC_LOG_DEBUG(("Parsing channel key payload"));
new = silc_calloc(1, sizeof(*new));
- if (!new) {
- SILC_LOG_ERROR(("Could not allocate new channel key payload"));
- return NULL;
- }
/* Parse the Channel Key Payload */
silc_buffer_unformat(buffer,
2 + cipher */
len = 2 + id_len + 2 + key_len + 2 + cipher_len;
buffer = silc_buffer_alloc(len);
- if (!buffer)
- return NULL;
silc_buffer_pull_tail(buffer, SILC_BUFFER_END(buffer));
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
SILC_LOG_DEBUG(("Parsing command payload"));
new = silc_calloc(1, sizeof(*new));
- if (!new) {
- SILC_LOG_ERROR(("Could not allocate new command payload"));
- return NULL;
- }
/* Parse the Command Payload */
silc_buffer_unformat(buffer,
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/*
* $Id$
* $Log$
+ * Revision 1.3 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
* Revision 1.2 2000/07/03 05:53:58 priikone
* Fixed file purging bug. The purging should work now ok.
*
* Revision 1.1.1.1 2000/06/27 11:36:55 priikone
- * Importet from internal CVS/Added Log headers.
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/*
* $Id$
* $Log$
+ * Revision 1.3 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
* Revision 1.2 2000/06/30 10:49:48 priikone
* Added SOCKS4 and SOCKS5 support for SILC client.
*
* Revision 1.1.1.1 2000/06/27 11:36:55 priikone
- * Importet from internal CVS/Added Log headers.
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
}
*new_protocol = silc_calloc(1, sizeof(**new_protocol));
- if (*new_protocol == NULL) {
- SILC_LOG_ERROR(("Cannot allocate new protocol object"));
- return;
- }
-
(*new_protocol)->protocol = (SilcProtocolObject *)&silc_protocol_list[i];
(*new_protocol)->state = SILC_PROTOCOL_STATE_UNKNOWN;
(*new_protocol)->context = context;
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
{
SILC_LOG_DEBUG(("Allocating new socket connection object"));
- *new_socket = silc_calloc(1, sizeof(**new_socket));
- if (*new_socket == NULL) {
- SILC_LOG_ERROR(("Could not allocate new socket connection object"));
- return;
- }
-
/* Set the pointers. Incoming and outgoing data buffers
are allocated by the server when they are first used. */
+ *new_socket = silc_calloc(1, sizeof(**new_socket));
(*new_socket)->sock = sock;
(*new_socket)->type = type;
(*new_socket)->user_data = user_data;
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:35 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
SILC_LOG_DEBUG(("Allocating new task queue"));
*new = silc_calloc(1, sizeof(**new));
- if (*new == NULL) {
- SILC_LOG_ERROR(("Could not allocate new task queue object: %s",
- strerror(errno)));
- return;
- }
/* Set the pointers */
(*new)->valid = valid;
}
new = silc_calloc(1, sizeof(*new));
- if (!new) {
- SILC_LOG_ERROR(("Could not allocate new task object"));
- return NULL;
- }
-
new->fd = fd;
new->context = context;
new->callback = cb;
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:54 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:08:43 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:54 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
SILC_LOG_DEBUG(("Registering new cipher"));
new = silc_calloc(1, sizeof(*new));
- if (!new) {
- SILC_LOG_ERROR(("Could not allocate new cipher list object: %s",
- strerror(errno)));
- return FALSE;
- }
-
new->cipher = silc_calloc(1, sizeof(*new->cipher));
- if (!new->cipher) {
- SILC_LOG_ERROR(("Could not allocate new cipher object: %s",
- strerror(errno)));
- return FALSE;
- }
/* Set the pointers */
new->cipher->name = strdup(cipher->name);
/* Allocate the new object */
*new_cipher = silc_calloc(1, sizeof(**new_cipher));
- if (*new_cipher == NULL) {
- SILC_LOG_ERROR(("Could not allocate new cipher object"));
- return FALSE;
- }
if (silc_cipher_list) {
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:08:43 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
SILC_LOG_DEBUG(("Registering new hash function"));
new = silc_calloc(1, sizeof(*new));
- if (!new) {
- SILC_LOG_ERROR(("Could not allocate new hash list object"));
- return FALSE;
- }
-
new->hash = silc_calloc(1, sizeof(*new->hash));
- if (!new->hash) {
- SILC_LOG_ERROR(("Could not allocate new hash object"));
- return FALSE;
- }
/* Set the pointers */
new->hash->name = silc_calloc(1, strlen(hash->name));
/* Allocate the new object */
*new_hash = silc_calloc(1, sizeof(**new_hash));
- if (*new_hash == NULL) {
- SILC_LOG_ERROR(("Could not allocate new hash object"));
- return FALSE;
- }
if (silc_hash_list) {
h = silc_hash_list;
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:08:43 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
SILC_LOG_DEBUG(("Allocating new hmac object"));
*new_hmac = silc_calloc(1, sizeof(**new_hmac));
- if (*new_hmac == NULL) {
- SILC_LOG_ERROR(("Could not allocate new hmac object"));
- return 0;
- }
-
(*new_hmac)->hash = hash;
(*new_hmac)->set_key = silc_hmac_set_key;
(*new_hmac)->make_hmac = silc_hmac_make;
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:55 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:08:43 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:55 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
SILC_LOG_DEBUG(("Allocating new RNG object"));
new = silc_calloc(1, sizeof(*new));
- if (!new) {
- SILC_LOG_ERROR(("Could not allocate new RNG object"));
- return NULL;
- }
memset(new->pool, 0, sizeof(new->pool));
memset(new->key, 0, sizeof(new->key));
SILC_LOG_DEBUG(("Initializing RNG object"));
/* Initialize the states for the RNG. */
- rng->state = silc_malloc(sizeof(*rng->state));
+ rng->state = silc_calloc(1, sizeof(*rng->state));
rng->state->low = 0;
rng->state->pos = 8;
rng->state->next = NULL;
first = rng->state;
for (i = SILC_RNG_STATE_NUM - 1; i >= 1; i--) {
- next = silc_malloc(sizeof(*rng->state));
+ next = silc_calloc(1, sizeof(*rng->state));
next->low =
(i * (sizeof(rng->pool) / SILC_RNG_STATE_NUM));
next->pos =
unsigned char *string;
string = silc_calloc((len * 2 + 1), sizeof(unsigned char));
- if (string == NULL)
- return NULL;
for (i = 0; i < len; i++)
sprintf(string + 2 * i, "%02x", silc_rng_get_byte(rng));
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:51 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:06:52 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:51 priikone
+ * Importet from internal CVS/Added Log headers.
*
*
*/
/* Init modulo table with the prime candidate and the primes
in the primetable. */
- spmods = silc_malloc(sizeof(primetable) * sizeof(unsigned int));
+ spmods = silc_calloc(1, sizeof(primetable) * sizeof(unsigned int));
for (i = 0; primetable[i] != 0; i++) {
silc_mp_mod_ui(&tmp, prime, primetable[i]);
spmods[i] = silc_mp_get_ui(&tmp);
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:56 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:05:15 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:56 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:56 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:05:15 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:56 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
/* Allocate channel payload buffer. */
buf = silc_buffer_alloc(payload->len);
- if (!buf) {
- SILC_LOG_ERROR(("Could not allocate encode buffer"));
- return SILC_SKE_STATUS_ERROR;
- }
silc_buffer_pull_tail(buf, payload->len);
/* Allocate channel payload buffer. The length of the buffer
is 2 + e. */
buf = silc_buffer_alloc(e_len + 2);
- if (!buf) {
- SILC_LOG_ERROR(("Could not allocate encode buffer"));
- return SILC_SKE_STATUS_ERROR;
- }
silc_buffer_pull_tail(buf, e_len + 2);
is 2 + 2 + public key + 2 + f + 2 + signature. */
len = payload->pk_len + 2 + 2 + f_len + 2 + payload->sign_len + 2;
buf = silc_buffer_alloc(len);
- if (!buf) {
- SILC_LOG_ERROR(("Could not allocate encode buffer"));
- return SILC_SKE_STATUS_ERROR;
- }
silc_buffer_pull_tail(buf, len);
/*
* $Id$
* $Log$
- * Revision 1.1 2000/06/27 11:36:56 priikone
- * Initial revision
+ * Revision 1.2 2000/07/05 06:05:15 priikone
+ * Global cosmetic change.
+ *
+ * Revision 1.1.1.1 2000/06/27 11:36:56 priikone
+ * Imported from internal CVS/Added Log headers.
*
*
*/
SILC_LOG_DEBUG(("Allocating new Key Exchange object"));
ske = silc_calloc(1, sizeof(*ske));
- if (!ske) {
- SILC_LOG_ERROR(("Could not allocate new SKE object"));
- return NULL;
- }
return ske;
}