diff options
author | Simon Josefsson <simon@josefsson.org> | 2008-10-08 17:09:58 +0200 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2008-10-08 17:09:58 +0200 |
commit | 0d91e8fb205e94169687f44bb338d3812dae372a (patch) | |
tree | 59ed59f6c55a35eec707ebd77d0e0fab7264ee17 /lib/opencdk | |
parent | ce23654ab3b8097241c1639ebe3e853c4f67b6d7 (diff) | |
download | gnutls-0d91e8fb205e94169687f44bb338d3812dae372a.tar.gz |
Indent.
Diffstat (limited to 'lib/opencdk')
-rw-r--r-- | lib/opencdk/armor.c | 78 | ||||
-rw-r--r-- | lib/opencdk/hash.c | 14 | ||||
-rw-r--r-- | lib/opencdk/kbnode.c | 26 | ||||
-rw-r--r-- | lib/opencdk/keydb.c | 268 | ||||
-rw-r--r-- | lib/opencdk/pubkey.c | 2 | ||||
-rw-r--r-- | lib/opencdk/stream.c | 130 |
6 files changed, 259 insertions, 259 deletions
diff --git a/lib/opencdk/armor.c b/lib/opencdk/armor.c index 59c0dfebef..37d0138f69 100644 --- a/lib/opencdk/armor.c +++ b/lib/opencdk/armor.c @@ -162,7 +162,7 @@ base64_encode (char *out, const byte * in, size_t len, size_t olen) { if (!out || !in) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -204,7 +204,7 @@ base64_decode (byte * out, const char *in) if (!out || !in) { - gnutls_assert(); + gnutls_assert (); return -1; } @@ -213,28 +213,28 @@ base64_decode (byte * out, const char *in) { digit1 = in[0]; if (digit1 > 127 || b64val (digit1) == BAD) - { - gnutls_assert(); - return -1; - } + { + gnutls_assert (); + return -1; + } digit2 = in[1]; if (digit2 > 127 || b64val (digit2) == BAD) - { - gnutls_assert(); + { + gnutls_assert (); return -1; - } + } digit3 = in[2]; if (digit3 > 127 || ((digit3 != '=') && (b64val (digit3) == BAD))) - { - gnutls_assert(); + { + gnutls_assert (); return -1; - } + } digit4 = in[3]; if (digit4 > 127 || ((digit4 != '=') && (b64val (digit4) == BAD))) { - gnutls_assert(); + gnutls_assert (); return -1; - } + } in += 4; /* digits are already sanity-checked */ @@ -323,7 +323,7 @@ is_armored (int ctb) if (!(ctb & 0x80)) { - gnutls_assert(); + gnutls_assert (); return 1; /* invalid packet: assume it is armored */ } pkttype = ctb & 0x40 ? (ctb & 0x3f) : ((ctb >> 2) & 0xf); @@ -370,13 +370,13 @@ armor_encode (void *data, FILE * in, FILE * out) if (!afx) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (afx->idx < 0 || afx->idx > (int) DIM (armor_begin) || afx->idx2 < 0 || afx->idx2 > (int) DIM (armor_end)) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -393,7 +393,7 @@ armor_encode (void *data, FILE * in, FILE * out) if (fstat (fileno (in), &statbuf)) { - gnutls_assert(); + gnutls_assert (); return CDK_General_Error; } @@ -403,10 +403,10 @@ armor_encode (void *data, FILE * in, FILE * out) if (!nread) break; if (ferror (in)) - { - gnutls_assert(); - return CDK_File_Error; - } + { + gnutls_assert (); + return CDK_File_Error; + } afx->crc = update_crc (afx->crc, (byte *) raw, nread); base64_encode (buf, (byte *) raw, nread, DIM (buf) - 1); fprintf (out, "%s%s", buf, lf); @@ -462,7 +462,7 @@ search_header (const char *buf, const char **array) if (strlen (buf) < 5 || strncmp (buf, "-----", 5)) { - gnutls_assert(); + gnutls_assert (); return -1; } for (i = 0; (s = array[i]); i++) @@ -495,7 +495,7 @@ armor_decode (void *data, FILE * in, FILE * out) if (!afx) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -515,7 +515,7 @@ armor_decode (void *data, FILE * in, FILE * out) if (feof (in) || !pgp_data) { - gnutls_assert(); + gnutls_assert (); return CDK_Armor_Error; /* no data found */ } @@ -534,10 +534,10 @@ armor_decode (void *data, FILE * in, FILE * out) Headers to be corruption of the ASCII Armor. A colon and a single space separate the key and value. */ if (!strstr (buf, ": ")) - { - gnutls_assert(); - return CDK_Armor_Error; - } + { + gnutls_assert (); + return CDK_Armor_Error; + } rc = CDK_General_Error; for (i = 0; (s = valid_headers[i]); i++) { @@ -625,7 +625,7 @@ cdk_file_armor (cdk_ctx_t hd, const char *file, const char *output) rc = cdk_stream_open (file, &inp); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -633,7 +633,7 @@ cdk_file_armor (cdk_ctx_t hd, const char *file, const char *output) if (rc) { cdk_stream_close (inp); - gnutls_assert(); + gnutls_assert (); return rc; } @@ -671,14 +671,14 @@ cdk_file_dearmor (const char *file, const char *output) rc = _cdk_check_args (1, file, output); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } rc = cdk_stream_open (file, &inp); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -686,7 +686,7 @@ cdk_file_dearmor (const char *file, const char *output) if (rc) { cdk_stream_close (inp); - gnutls_assert(); + gnutls_assert (); return rc; } @@ -706,7 +706,7 @@ cdk_file_dearmor (const char *file, const char *output) cdk_stream_close (inp); cdk_stream_close (out); - gnutls_assert(); + gnutls_assert (); return rc; } @@ -730,7 +730,7 @@ _cdk_filter_armor (void *data, int ctl, FILE * in, FILE * out) } } - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } @@ -758,12 +758,12 @@ cdk_armor_encode_buffer (const byte * inbuf, size_t inlen, if (!inbuf || !nwritten) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (type > CDK_ARMOR_SIGNATURE) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } @@ -776,7 +776,7 @@ cdk_armor_encode_buffer (const byte * inbuf, size_t inlen, if (outbuf && outlen < pos) { - gnutls_assert(); + gnutls_assert (); return CDK_Too_Short; } diff --git a/lib/opencdk/hash.c b/lib/opencdk/hash.c index 61fadd6dad..cddcbc216f 100644 --- a/lib/opencdk/hash.c +++ b/lib/opencdk/hash.c @@ -42,7 +42,7 @@ hash_encode (void *data, FILE * in, FILE * out) if (!mfx) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -52,10 +52,10 @@ hash_encode (void *data, FILE * in, FILE * out) { err = _gnutls_hash_init (&mfx->md, mfx->digest_algo); if (err < 0) - { - gnutls_assert(); - return map_gnutls_error (err); - } + { + gnutls_assert (); + return map_gnutls_error (err); + } mfx->md_initialized = 1; } @@ -88,7 +88,7 @@ _cdk_filter_hash (void *data, int ctl, FILE * in, FILE * out) return 0; } } - - gnutls_assert(); + + gnutls_assert (); return CDK_Inv_Mode; } diff --git a/lib/opencdk/kbnode.c b/lib/opencdk/kbnode.c index e9374c87eb..376f308582 100644 --- a/lib/opencdk/kbnode.c +++ b/lib/opencdk/kbnode.c @@ -448,7 +448,7 @@ cdk_kbnode_write_to_mem_alloc (cdk_kbnode_t node, if (!node || !r_buf || !r_buflen) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -458,7 +458,7 @@ cdk_kbnode_write_to_mem_alloc (cdk_kbnode_t node, rc = cdk_stream_tmp_new (&s); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -477,7 +477,7 @@ cdk_kbnode_write_to_mem_alloc (cdk_kbnode_t node, if (rc) { cdk_stream_close (s); - gnutls_assert(); + gnutls_assert (); return rc; } } @@ -512,14 +512,14 @@ cdk_kbnode_write_to_mem (cdk_kbnode_t node, byte * buf, size_t * r_nbytes) if (!node || !r_nbytes) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } rc = cdk_stream_tmp_new (&s); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -538,7 +538,7 @@ cdk_kbnode_write_to_mem (cdk_kbnode_t node, byte * buf, size_t * r_nbytes) if (rc) { cdk_stream_close (s); - gnutls_assert(); + gnutls_assert (); return rc; } } @@ -559,7 +559,7 @@ cdk_kbnode_write_to_mem (cdk_kbnode_t node, byte * buf, size_t * r_nbytes) if (!rc) *r_nbytes = cdk_stream_read (s, buf, len); else - gnutls_assert(); + gnutls_assert (); cdk_stream_close (s); return rc; } @@ -586,7 +586,7 @@ cdk_kbnode_hash (cdk_kbnode_t node, digest_hd_st * md, int is_v4, if (!node || !md) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (!pkttype) @@ -598,10 +598,10 @@ cdk_kbnode_hash (cdk_kbnode_t node, digest_hd_st * md, int is_v4, { pkt = cdk_kbnode_find_packet (node, pkttype); if (!pkt) - { - gnutls_assert(); - return CDK_Inv_Packet; - } + { + gnutls_assert (); + return CDK_Inv_Packet; + } } switch (pkttype) @@ -620,7 +620,7 @@ cdk_kbnode_hash (cdk_kbnode_t node, digest_hd_st * md, int is_v4, break; default: - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } return 0; diff --git a/lib/opencdk/keydb.c b/lib/opencdk/keydb.c index 484792d7f5..651a205bb0 100644 --- a/lib/opencdk/keydb.c +++ b/lib/opencdk/keydb.c @@ -82,14 +82,14 @@ keydb_idx_build (const char *file) if (!file) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } rc = cdk_stream_open (file, &inp); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -97,7 +97,7 @@ keydb_idx_build (const char *file) if (!idx_name) { cdk_stream_close (inp); - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } rc = cdk_stream_create (idx_name, &out); @@ -105,7 +105,7 @@ keydb_idx_build (const char *file) if (rc) { cdk_stream_close (inp); - gnutls_assert(); + gnutls_assert (); return rc; } @@ -138,7 +138,7 @@ keydb_idx_build (const char *file) cdk_stream_close (out); cdk_stream_close (inp); - gnutls_assert(); + gnutls_assert (); return rc; } @@ -159,7 +159,7 @@ cdk_keydb_idx_rebuild (cdk_keydb_hd_t db, cdk_keydb_search_t dbs) if (!db || !db->name || !dbs) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (db->secret) @@ -168,7 +168,7 @@ cdk_keydb_idx_rebuild (cdk_keydb_hd_t db, cdk_keydb_search_t dbs) tmp_idx_name = keydb_idx_mkname (db->name); if (!tmp_idx_name) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } err = stat (tmp_idx_name, &stbuf); @@ -184,16 +184,16 @@ cdk_keydb_idx_rebuild (cdk_keydb_hd_t db, cdk_keydb_search_t dbs) { dbs->idx_name = keydb_idx_mkname (db->name); if (!dbs->idx_name) - { - gnutls_assert(); - return CDK_Out_Of_Core; - } + { + gnutls_assert (); + return CDK_Out_Of_Core; + } } rc = keydb_idx_build (db->name); if (!rc) rc = cdk_stream_open (dbs->idx_name, &dbs->idx); else - gnutls_assert(); + gnutls_assert (); return rc; } @@ -206,14 +206,14 @@ keydb_idx_parse (cdk_stream_t inp, key_idx_t * r_idx) if (!inp || !r_idx) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } idx = cdk_calloc (1, sizeof *idx); if (!idx) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } @@ -242,12 +242,12 @@ keydb_idx_search (cdk_stream_t inp, u32 * keyid, const byte * fpr, if (!inp || !r_off) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if ((keyid && fpr) || (!keyid && !fpr)) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } @@ -293,7 +293,7 @@ cdk_keydb_new_from_mem (cdk_keydb_hd_t * r_db, int secret, if (!r_db) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } *r_db = NULL; @@ -302,7 +302,7 @@ cdk_keydb_new_from_mem (cdk_keydb_hd_t * r_db, int secret, if (!db->fp) { cdk_free (db); - gnutls_assert(); + gnutls_assert (); return rc; } if (cdk_armor_filter_use (db->fp)) @@ -331,7 +331,7 @@ cdk_keydb_new_from_stream (cdk_keydb_hd_t * r_hd, int secret, cdk_stream_t in) if (!r_hd) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } *r_hd = NULL; @@ -357,7 +357,7 @@ cdk_keydb_new_from_file (cdk_keydb_hd_t * r_hd, int secret, const char *fname) if (!r_hd) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } *r_hd = NULL; @@ -366,7 +366,7 @@ cdk_keydb_new_from_file (cdk_keydb_hd_t * r_hd, int secret, const char *fname) if (!hd->name) { cdk_free (hd); - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } hd->type = secret ? CDK_DBTYPE_SK_KEYRING : CDK_DBTYPE_PK_KEYRING; @@ -403,10 +403,10 @@ cdk_keydb_new (cdk_keydb_hd_t * r_hd, int type, void *data, size_t count) return cdk_keydb_new_from_stream (r_hd, 0, (cdk_stream_t) data); default: - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } @@ -450,7 +450,7 @@ _cdk_keydb_open (cdk_keydb_hd_t hd, cdk_stream_t * ret_kr) if (!hd || !ret_kr) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -474,7 +474,7 @@ _cdk_keydb_open (cdk_keydb_hd_t hd, cdk_stream_t * ret_kr) } else { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } @@ -652,7 +652,7 @@ keydb_cache_add (cdk_keydb_search_t dbs, off_t offset) k = cdk_calloc (1, sizeof *k); if (!k) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } @@ -729,19 +729,19 @@ cdk_keydb_search_start (cdk_keydb_search_t * st, cdk_keydb_hd_t db, int type, if (!db) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (type != CDK_DBSEARCH_NEXT && !desc) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } *st = cdk_calloc (1, sizeof (cdk_keydb_search_s)); if (!(*st)) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } @@ -749,7 +749,7 @@ cdk_keydb_search_start (cdk_keydb_search_t * st, cdk_keydb_hd_t db, int type, if (rc != CDK_Success) { free (*st); - gnutls_assert(); + gnutls_assert (); return rc; } @@ -763,7 +763,7 @@ cdk_keydb_search_start (cdk_keydb_search_t * st, cdk_keydb_hd_t db, int type, if (!(*st)->u.pattern) { cdk_free (*st); - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } break; @@ -798,7 +798,7 @@ cdk_keydb_search_start (cdk_keydb_search_t * st, cdk_keydb_hd_t db, int type, if (!p) { cdk_free (*st); - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } break; @@ -821,8 +821,8 @@ cdk_keydb_search_start (cdk_keydb_search_t * st, cdk_keydb_hd_t db, int type, else { /* Invalid key ID object. */ cdk_free (*st); - gnutls_assert(); - return CDK_Inv_Mode; + gnutls_assert (); + return CDK_Inv_Mode; } break; @@ -831,7 +831,7 @@ cdk_keydb_search_start (cdk_keydb_search_t * st, cdk_keydb_hd_t db, int type, if (strlen (p) != 2 * KEY_FPR_LEN) { cdk_free (*st); - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } for (i = 0; i < KEY_FPR_LEN; i++) @@ -848,7 +848,7 @@ cdk_keydb_search_start (cdk_keydb_search_t * st, cdk_keydb_hd_t db, int type, default: cdk_free (*st); _cdk_log_debug ("cdk_keydb_search_start: invalid mode = %d\n", type); - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } @@ -864,7 +864,7 @@ keydb_pos_from_cache (cdk_keydb_hd_t hd, cdk_keydb_search_t ks, if (!hd || !r_cache_hit || !r_off) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -891,9 +891,9 @@ keydb_pos_from_cache (cdk_keydb_hd_t hd, cdk_keydb_search_t ks, { if (keydb_idx_search (ks->idx, ks->u.keyid, NULL, r_off)) { - gnutls_assert(); + gnutls_assert (); return CDK_Error_No_Key; - } + } _cdk_log_debug ("cache: found keyid entry in idx table.\n"); *r_cache_hit = 1; } @@ -901,9 +901,9 @@ keydb_pos_from_cache (cdk_keydb_hd_t hd, cdk_keydb_search_t ks, { if (keydb_idx_search (ks->idx, NULL, ks->u.fpr, r_off)) { - gnutls_assert(); + gnutls_assert (); return CDK_Error_No_Key; - } + } _cdk_log_debug ("cache: found fpr entry in idx table.\n"); *r_cache_hit = 1; } @@ -949,7 +949,7 @@ cdk_keydb_search (cdk_keydb_search_t st, cdk_keydb_hd_t hd, if (!hd || !ret_key || !st) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -959,7 +959,7 @@ cdk_keydb_search (cdk_keydb_search_t st, cdk_keydb_hd_t hd, rc = _cdk_keydb_open (hd, &kr); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -990,11 +990,11 @@ cdk_keydb_search (cdk_keydb_search_t st, cdk_keydb_hd_t hd, { if (rc == CDK_EOF) break; - else + else { - gnutls_assert(); + gnutls_assert (); return rc; - } + } } switch (st->type) @@ -1034,7 +1034,7 @@ cdk_keydb_search (cdk_keydb_search_t st, cdk_keydb_hd_t hd, rc = 0; else if (rc == CDK_EOF && !key_found) { - gnutls_assert(); + gnutls_assert (); rc = CDK_Error_No_Key; } *ret_key = key_found ? knode : NULL; @@ -1049,7 +1049,7 @@ cdk_keydb_get_bykeyid (cdk_keydb_hd_t hd, u32 * keyid, cdk_kbnode_t * ret_key) if (!hd || !keyid || !ret_key) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -1071,7 +1071,7 @@ cdk_keydb_get_byfpr (cdk_keydb_hd_t hd, const byte * fpr, if (!hd || !fpr || !r_key) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -1093,7 +1093,7 @@ cdk_keydb_get_bypattern (cdk_keydb_hd_t hd, const char *patt, if (!hd || !patt || !ret_key) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -1102,7 +1102,7 @@ cdk_keydb_get_bypattern (cdk_keydb_hd_t hd, const char *patt, rc = cdk_keydb_search (st, hd, ret_key); if (rc) - gnutls_assert(); + gnutls_assert (); cdk_keydb_search_release (st); return rc; @@ -1232,13 +1232,13 @@ _cdk_keydb_get_sk_byusage (cdk_keydb_hd_t hd, const char *name, if (!ret_sk || !usage) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (!hd) { - gnutls_assert(); + gnutls_assert (); return CDK_Error_No_Keyring; } @@ -1246,16 +1246,16 @@ _cdk_keydb_get_sk_byusage (cdk_keydb_hd_t hd, const char *name, rc = cdk_keydb_search_start (&st, hd, CDK_DBSEARCH_AUTO, (char *) name); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } rc = cdk_keydb_search (st, hd, &knode); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; - } + } cdk_keydb_search_release (st); @@ -1263,7 +1263,7 @@ _cdk_keydb_get_sk_byusage (cdk_keydb_hd_t hd, const char *name, if (!sk_node) { cdk_kbnode_release (knode); - gnutls_assert(); + gnutls_assert (); return CDK_Unusable_Key; } @@ -1291,7 +1291,7 @@ _cdk_keydb_get_sk_byusage (cdk_keydb_hd_t hd, const char *name, if (!pk_node) { cdk_kbnode_release (knode); - gnutls_assert(); + gnutls_assert (); return CDK_Unusable_Key; } node = find_selfsig_node (knode, pk_node->pkt->pkt.secret_key->pk); @@ -1318,12 +1318,12 @@ _cdk_keydb_get_pk_byusage (cdk_keydb_hd_t hd, const char *name, if (!ret_pk || !usage) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (!hd) { - gnutls_assert(); + gnutls_assert (); return CDK_Error_No_Keyring; } @@ -1333,7 +1333,7 @@ _cdk_keydb_get_pk_byusage (cdk_keydb_hd_t hd, const char *name, rc = cdk_keydb_search (st, hd, &knode); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -1343,7 +1343,7 @@ _cdk_keydb_get_pk_byusage (cdk_keydb_hd_t hd, const char *name, if (!node) { cdk_kbnode_release (knode); - gnutls_assert(); + gnutls_assert (); return CDK_Unusable_Key; } @@ -1368,7 +1368,7 @@ _cdk_keydb_get_pk_byusage (cdk_keydb_hd_t hd, const char *name, if (!pk_node) { cdk_kbnode_release (knode); - gnutls_assert(); + gnutls_assert (); return CDK_Unusable_Key; } node = find_selfsig_node (knode, pk_node->pkt->pkt.public_key); @@ -1402,12 +1402,12 @@ cdk_keydb_get_pk (cdk_keydb_hd_t hd, u32 * keyid, cdk_pubkey_t * r_pk) if (!keyid || !r_pk) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (!hd) { - gnutls_assert(); + gnutls_assert (); return CDK_Error_No_Keyring; } @@ -1416,13 +1416,13 @@ cdk_keydb_get_pk (cdk_keydb_hd_t hd, u32 * keyid, cdk_pubkey_t * r_pk) rc = cdk_keydb_search_start (&st, hd, s_type, keyid); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } rc = cdk_keydb_search (st, hd, &knode); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -1432,7 +1432,7 @@ cdk_keydb_get_pk (cdk_keydb_hd_t hd, u32 * keyid, cdk_pubkey_t * r_pk) if (!node) { cdk_kbnode_release (knode); - gnutls_assert(); + gnutls_assert (); return CDK_Error_No_Key; } @@ -1466,12 +1466,12 @@ cdk_keydb_get_sk (cdk_keydb_hd_t hd, u32 * keyid, cdk_seckey_t * ret_sk) if (!keyid || !ret_sk) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (!hd) { - gnutls_assert(); + gnutls_assert (); return CDK_Error_No_Keyring; } @@ -1479,7 +1479,7 @@ cdk_keydb_get_sk (cdk_keydb_hd_t hd, u32 * keyid, cdk_seckey_t * ret_sk) rc = cdk_keydb_get_bykeyid (hd, keyid, &snode); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -1487,7 +1487,7 @@ cdk_keydb_get_sk (cdk_keydb_hd_t hd, u32 * keyid, cdk_seckey_t * ret_sk) if (!node) { cdk_kbnode_release (snode); - gnutls_assert(); + gnutls_assert (); return CDK_Error_No_Key; } @@ -1578,7 +1578,7 @@ keydb_merge_selfsig (cdk_kbnode_t key, u32 * keyid) if (!key) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -1588,10 +1588,10 @@ keydb_merge_selfsig (cdk_kbnode_t key, u32 * keyid) continue; unode = cdk_kbnode_find_prev (key, node, CDK_PKT_USER_ID); if (!unode) - { - gnutls_assert(); + { + gnutls_assert (); return CDK_Error_No_Key; - } + } uid = unode->pkt->pkt.user_id; sig = node->pkt->pkt.signature; s = cdk_subpkt_find (sig->hashed, CDK_SIGSUBPKT_PRIMARY_UID); @@ -1633,9 +1633,9 @@ keydb_merge_selfsig (cdk_kbnode_t key, u32 * keyid) uid->prefs = cdk_calloc (1, sizeof (*uid->prefs) * (n + 1)); if (!uid->prefs) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; - } + } n = 0; for (; nsymalg; nsymalg--, n++) { @@ -1696,12 +1696,12 @@ keydb_parse_allsigs (cdk_kbnode_t knode, cdk_keydb_hd_t hd, int check) if (!knode) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (check && !hd) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } @@ -1722,7 +1722,7 @@ keydb_parse_allsigs (cdk_kbnode_t knode, cdk_keydb_hd_t hd, int check) kb = cdk_kbnode_find (knode, CDK_PKT_PUBLIC_KEY); if (!kb) { - gnutls_assert(); + gnutls_assert (); return CDK_Wrong_Format; } cdk_pk_get_keyid (kb->pkt->pkt.public_key, keyid); @@ -1743,10 +1743,10 @@ keydb_parse_allsigs (cdk_kbnode_t knode, cdk_keydb_hd_t hd, int check) _cdk_pk_check_sig (hd, kb, node, NULL, NULL); } else - { - gnutls_assert(); + { + gnutls_assert (); return CDK_Error_No_Key; - } + } } /* Revocation certificates for subkeys */ else if (sig->sig_class == 0x28) @@ -1759,10 +1759,10 @@ keydb_parse_allsigs (cdk_kbnode_t knode, cdk_keydb_hd_t hd, int check) _cdk_pk_check_sig (hd, kb, node, NULL, NULL); } else - { - gnutls_assert(); + { + gnutls_assert (); return CDK_Error_No_Key; - } + } } /* Revocation certifcates for user ID's */ else if (sig->sig_class == 0x30) @@ -1777,10 +1777,10 @@ keydb_parse_allsigs (cdk_kbnode_t knode, cdk_keydb_hd_t hd, int check) _cdk_pk_check_sig (hd, kb, node, NULL, NULL); } else - { - gnutls_assert(); + { + gnutls_assert (); return CDK_Error_No_Key; - } + } } /* Direct certificates for primary keys */ else if (sig->sig_class == 0x1F) @@ -1802,10 +1802,10 @@ keydb_parse_allsigs (cdk_kbnode_t knode, cdk_keydb_hd_t hd, int check) _cdk_pk_check_sig (hd, kb, node, NULL, NULL); } else - { - gnutls_assert(); + { + gnutls_assert (); return CDK_Error_No_Key; - } + } } /* Direct certificates for subkeys */ else if (sig->sig_class == 0x18) @@ -1827,10 +1827,10 @@ keydb_parse_allsigs (cdk_kbnode_t knode, cdk_keydb_hd_t hd, int check) _cdk_pk_check_sig (hd, kb, node, NULL, NULL); } else - { - gnutls_assert(); + { + gnutls_assert (); return CDK_Error_No_Key; - } + } } } } @@ -1899,7 +1899,7 @@ cdk_keydb_get_keyblock (cdk_stream_t inp, cdk_kbnode_t * r_knode) if (!inp || !r_knode) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -1926,7 +1926,7 @@ cdk_keydb_get_keyblock (cdk_stream_t inp, cdk_kbnode_t * r_knode) { /* Release all packets we reached so far. */ _cdk_log_debug ("keydb_get_keyblock: error %d\n", rc); cdk_kbnode_release (knode); - gnutls_assert(); + gnutls_assert (); return rc; } } @@ -2089,25 +2089,25 @@ cdk_keydb_export (cdk_keydb_hd_t hd, cdk_stream_t out, cdk_strlist_t remusr) { rc = cdk_keydb_search_start (&st, hd, CDK_DBSEARCH_AUTO, r->d); if (rc) - { - gnutls_assert(); - return rc; - } + { + gnutls_assert (); + return rc; + } rc = cdk_keydb_search (st, hd, &knode); cdk_keydb_search_release (st); if (rc) - { - gnutls_assert(); + { + gnutls_assert (); return rc; - } + } node = cdk_kbnode_find (knode, CDK_PKT_PUBLIC_KEY); if (!node) - { - gnutls_assert(); + { + gnutls_assert (); return CDK_Error_No_Key; - } + } /* If the key is a version 3 key, use the old packet format for the output. */ @@ -2136,7 +2136,7 @@ cdk_keydb_export (cdk_keydb_hd_t hd, cdk_stream_t out, cdk_strlist_t remusr) if (rc) { cdk_kbnode_release (knode); - gnutls_assert(); + gnutls_assert (); return rc; } } @@ -2197,14 +2197,14 @@ cdk_keydb_import (cdk_keydb_hd_t hd, cdk_kbnode_t knode) if (!hd || !knode) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } pkt = find_key_packet (knode, NULL); if (!pkt) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Packet; } @@ -2228,7 +2228,7 @@ cdk_keydb_import (cdk_keydb_hd_t hd, cdk_kbnode_t knode) rc = _cdk_stream_append (hd->name, &out); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -2254,7 +2254,7 @@ cdk_keydb_import (cdk_keydb_hd_t hd, cdk_kbnode_t knode) if (rc) { cdk_stream_close (out); - gnutls_assert(); + gnutls_assert (); return rc; } } @@ -2276,14 +2276,14 @@ _cdk_keydb_check_userid (cdk_keydb_hd_t hd, u32 * keyid, const char *id) if (!hd) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } rc = cdk_keydb_search_start (&st, hd, CDK_DBSEARCH_KEYID, keyid); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } rc = cdk_keydb_search (st, hd, &knode); @@ -2291,7 +2291,7 @@ _cdk_keydb_check_userid (cdk_keydb_hd_t hd, u32 * keyid, const char *id) if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -2304,7 +2304,7 @@ _cdk_keydb_check_userid (cdk_keydb_hd_t hd, u32 * keyid, const char *id) if (rc) { cdk_kbnode_release (knode); - gnutls_assert(); + gnutls_assert (); return rc; } @@ -2343,19 +2343,19 @@ cdk_keydb_check_sk (cdk_keydb_hd_t hd, u32 * keyid) if (!hd || !keyid) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (!hd->secret) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } rc = _cdk_keydb_open (hd, &db); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } cdk_pkt_new (&pkt); @@ -2376,7 +2376,7 @@ cdk_keydb_check_sk (cdk_keydb_hd_t hd, u32 * keyid) cdk_pkt_free (pkt); } cdk_pkt_release (pkt); - gnutls_assert(); + gnutls_assert (); return CDK_Error_No_Key; } @@ -2403,24 +2403,24 @@ cdk_listkey_start (cdk_listkey_t * r_ctx, cdk_keydb_hd_t db, if (!r_ctx || !db) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if ((patt && fpatt) || (!patt && !fpatt)) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } rc = _cdk_keydb_open (db, &inp); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } ctx = cdk_calloc (1, sizeof *ctx); - if (!ctx) + if (!ctx) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } ctx->db = db; @@ -2429,10 +2429,10 @@ cdk_listkey_start (cdk_listkey_t * r_ctx, cdk_keydb_hd_t db, { ctx->u.patt = cdk_strdup (patt); if (!ctx->u.patt) - { - gnutls_assert(); + { + gnutls_assert (); return CDK_Out_Of_Core; - } + } } else if (fpatt) { @@ -2479,12 +2479,12 @@ cdk_listkey_next (cdk_listkey_t ctx, cdk_kbnode_t * ret_key) { if (!ctx || !ret_key) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (!ctx->init) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } @@ -2501,9 +2501,9 @@ cdk_listkey_next (cdk_listkey_t ctx, cdk_kbnode_t * ret_key) rc = cdk_keydb_get_keyblock (ctx->inp, &node); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; - } + } memset (&ks, 0, sizeof (ks)); ks.type = CDK_DBSEARCH_SUBSTR; ks.u.pattern = ctx->u.patt; @@ -2526,7 +2526,7 @@ cdk_listkey_next (cdk_listkey_t ctx, cdk_kbnode_t * ret_key) return CDK_EOF; return cdk_keydb_get_bypattern (ctx->db, ctx->t->d, ret_key); } - gnutls_assert(); + gnutls_assert (); return CDK_General_Error; } diff --git a/lib/opencdk/pubkey.c b/lib/opencdk/pubkey.c index d4ad65f83f..2e44bfcf03 100644 --- a/lib/opencdk/pubkey.c +++ b/lib/opencdk/pubkey.c @@ -116,7 +116,7 @@ cdk_pk_verify (cdk_pubkey_t pk, cdk_pkt_signature_t sig, const byte * md) data.size = enclen; params.params_nr = cdk_pk_get_npkey (pk->pubkey_algo); - for (i=0;i<params.params_nr;i++) + for (i = 0; i < params.params_nr; i++) params.params[i] = pk->mpi[i]; params.flags = 0; ret = _gnutls_pk_verify (algo, &data, &s_sig, ¶ms); diff --git a/lib/opencdk/stream.c b/lib/opencdk/stream.c index 6abc4dc043..d1061925b8 100644 --- a/lib/opencdk/stream.c +++ b/lib/opencdk/stream.c @@ -79,7 +79,7 @@ _cdk_stream_open_mode (const char *file, const char *mode, if (!file || !ret_s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -88,14 +88,14 @@ _cdk_stream_open_mode (const char *file, const char *mode, s = cdk_calloc (1, sizeof *s); if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } s->fname = cdk_strdup (file); if (!s->fname) { cdk_free (s); - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } s->fp = fopen (file, mode); @@ -103,7 +103,7 @@ _cdk_stream_open_mode (const char *file, const char *mode, { cdk_free (s->fname); cdk_free (s); - gnutls_assert(); + gnutls_assert (); return CDK_File_Error; } _cdk_log_debug ("open stream fd=%d\n", fileno (s->fp)); @@ -130,7 +130,7 @@ cdk_stream_new_from_cbs (cdk_stream_cbs_t cbs, void *opa, if (!cbs || !opa || !ret_s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -138,7 +138,7 @@ cdk_stream_new_from_cbs (cdk_stream_cbs_t cbs, void *opa, s = cdk_calloc (1, sizeof *s); if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } @@ -172,7 +172,7 @@ cdk_stream_new (const char *file, cdk_stream_t * ret_s) if (!ret_s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -181,7 +181,7 @@ cdk_stream_new (const char *file, cdk_stream_t * ret_s) s = cdk_calloc (1, sizeof *s); if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } s->flags.write = 1; @@ -193,7 +193,7 @@ cdk_stream_new (const char *file, cdk_stream_t * ret_s) if (!s->fname) { cdk_free (s); - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } } @@ -202,7 +202,7 @@ cdk_stream_new (const char *file, cdk_stream_t * ret_s) { cdk_free (s->fname); cdk_free (s); - gnutls_assert(); + gnutls_assert (); return CDK_File_Error; } _cdk_log_debug ("new stream fd=%d\n", fileno (s->fp)); @@ -226,7 +226,7 @@ cdk_stream_create (const char *file, cdk_stream_t * ret_s) if (!file || !ret_s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -235,7 +235,7 @@ cdk_stream_create (const char *file, cdk_stream_t * ret_s) s = cdk_calloc (1, sizeof *s); if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } s->flags.write = 1; @@ -244,7 +244,7 @@ cdk_stream_create (const char *file, cdk_stream_t * ret_s) if (!s->fname) { cdk_free (s); - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } s->fp = fopen (file, "w+b"); @@ -252,7 +252,7 @@ cdk_stream_create (const char *file, cdk_stream_t * ret_s) { cdk_free (s->fname); cdk_free (s); - gnutls_assert(); + gnutls_assert (); return CDK_File_Error; } _cdk_log_debug ("stream create fd=%d\n", fileno (s->fp)); @@ -294,7 +294,7 @@ cdk_stream_tmp_from_mem (const void *buf, size_t buflen, cdk_stream_t * r_out) rc = cdk_stream_tmp_new (&s); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -302,7 +302,7 @@ cdk_stream_tmp_from_mem (const void *buf, size_t buflen, cdk_stream_t * r_out) if (nwritten == EOF) { cdk_stream_close (s); - gnutls_assert(); + gnutls_assert (); return s->error; } cdk_stream_seek (s, 0); @@ -320,7 +320,7 @@ _cdk_stream_fpopen (FILE * fp, unsigned write_mode, cdk_stream_t * ret_out) s = cdk_calloc (1, sizeof *s); if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } @@ -343,7 +343,7 @@ _cdk_stream_append (const char *file, cdk_stream_t * ret_s) if (!ret_s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } *ret_s = NULL; @@ -351,7 +351,7 @@ _cdk_stream_append (const char *file, cdk_stream_t * ret_s) rc = _cdk_stream_open_mode (file, "a+b", &s); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } @@ -394,7 +394,7 @@ cdk_stream_flush (cdk_stream_t s) if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -419,7 +419,7 @@ cdk_stream_flush (cdk_stream_t s) if (rc) { s->error = rc; - gnutls_assert(); + gnutls_assert (); return rc; } } @@ -453,7 +453,7 @@ cdk_stream_close (cdk_stream_t s) if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -469,7 +469,7 @@ cdk_stream_close (cdk_stream_t s) else rc = 0; cdk_free (s); - gnutls_assert(); + gnutls_assert (); return rc; } @@ -510,7 +510,7 @@ cdk_stream_close (cdk_stream_t s) s->cache.alloced = 0; cdk_free (s); - gnutls_assert(); + gnutls_assert (); return rc; } @@ -570,7 +570,7 @@ cdk_stream_get_length (cdk_stream_t s) if (!s) { - gnutls_assert(); + gnutls_assert (); return (off_t) - 1; } @@ -582,14 +582,14 @@ cdk_stream_get_length (cdk_stream_t s) if (rc) { s->error = rc; - gnutls_assert(); + gnutls_assert (); return (off_t) - 1; } if (fstat (fileno (s->fp), &statbuf)) { s->error = CDK_File_Error; - gnutls_assert(); + gnutls_assert (); return (off_t) - 1; } @@ -727,14 +727,14 @@ cdk_stream_filter_disable (cdk_stream_t s, int type) if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } fnc = stream_id_to_filter (type); if (!fnc) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } f = filter_search (s, fnc); @@ -757,7 +757,7 @@ stream_fp_replace (cdk_stream_t s, FILE ** tmp) rc = fclose (s->fp); if (rc) { - gnutls_assert(); + gnutls_assert (); return CDK_File_Error; } s->fp = *tmp; @@ -779,7 +779,7 @@ stream_filter_write (cdk_stream_t s) if (s->flags.filtrated) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -933,7 +933,7 @@ cdk_stream_read (cdk_stream_t s, void *buf, size_t buflen) if (!s) { s->error = CDK_Inv_Value; - gnutls_assert(); + gnutls_assert (); return EOF; } @@ -947,7 +947,7 @@ cdk_stream_read (cdk_stream_t s, void *buf, size_t buflen) if (s->flags.write && !s->flags.temp) { s->error = CDK_Inv_Mode; - gnutls_assert(); + gnutls_assert (); return EOF; /* This is a write stream */ } @@ -959,7 +959,7 @@ cdk_stream_read (cdk_stream_t s, void *buf, size_t buflen) s->error = rc; if (feof (s->fp)) s->flags.eof = 1; - gnutls_assert(); + gnutls_assert (); return EOF; } s->flags.filtrated = 1; @@ -990,14 +990,14 @@ cdk_stream_getc (cdk_stream_t s) if (!s) { s->error = CDK_Inv_Value; - gnutls_assert(); + gnutls_assert (); return EOF; } nread = cdk_stream_read (s, buf, 1); if (nread == EOF) { s->error = CDK_File_Error; - gnutls_assert(); + gnutls_assert (); return EOF; } return buf[0]; @@ -1023,7 +1023,7 @@ cdk_stream_write (cdk_stream_t s, const void *buf, size_t count) if (!s) { s->error = CDK_Inv_Value; - gnutls_assert(); + gnutls_assert (); return EOF; } @@ -1037,7 +1037,7 @@ cdk_stream_write (cdk_stream_t s, const void *buf, size_t count) if (!s->flags.write) { s->error = CDK_Inv_Mode; /* this is a read stream */ - gnutls_assert(); + gnutls_assert (); return EOF; } @@ -1082,7 +1082,7 @@ cdk_stream_putc (cdk_stream_t s, int c) if (!s) { s->error = CDK_Inv_Value; - gnutls_assert(); + gnutls_assert (); return EOF; } buf[0] = c; @@ -1107,7 +1107,7 @@ cdk_stream_seek (cdk_stream_t s, off_t offset) if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -1127,7 +1127,7 @@ cdk_stream_seek (cdk_stream_t s, off_t offset) if (fseek (s->fp, offset, SEEK_SET)) { - gnutls_assert(); + gnutls_assert (); return CDK_File_Error; } return 0; @@ -1164,13 +1164,13 @@ cdk_stream_set_armor_flag (cdk_stream_t s, int armor_type) if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } f = filter_add (s, _cdk_filter_armor, fARMOR); if (!f) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } f->u.afx.idx = f->u.afx.idx2 = armor_type; @@ -1201,7 +1201,7 @@ cdk_stream_set_literal_flag (cdk_stream_t s, cdk_lit_format_t mode, if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -1209,7 +1209,7 @@ cdk_stream_set_literal_flag (cdk_stream_t s, cdk_lit_format_t mode, f = filter_add (s, _cdk_filter_literal, fLITERAL); if (!f) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } f->u.pfx.mode = mode; @@ -1240,7 +1240,7 @@ cdk_error_t cdk_stream_set_compress_flag (cdk_stream_t s, int algo, int level) { - gnutls_assert(); + gnutls_assert (); return CDK_Not_Implemented; #if 0 @@ -1273,13 +1273,13 @@ cdk_stream_set_text_flag (cdk_stream_t s, const char *lf) if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } f = filter_add (s, _cdk_filter_text, fTEXT); if (!f) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } f->ctl = stream_get_mode (s); @@ -1303,18 +1303,18 @@ cdk_stream_set_hash_flag (cdk_stream_t s, int digest_algo) if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (stream_get_mode (s)) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } f = filter_add (s, _cdk_filter_hash, fHASH); if (!f) { - gnutls_assert(); + gnutls_assert (); return CDK_Out_Of_Core; } f->ctl = stream_get_mode (s); @@ -1336,12 +1336,12 @@ cdk_stream_enable_cache (cdk_stream_t s, int val) { if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } if (!s->flags.write) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } s->cache.on = val; @@ -1368,10 +1368,10 @@ stream_cache_flush (cdk_stream_t s, FILE * fp) { nwritten = fwrite (s->cache.buf, 1, s->cache.size, fp); if (!nwritten) - { - gnutls_assert(); + { + gnutls_assert (); return CDK_File_Error; - } + } s->cache.size = 0; s->cache.on = 0; wipemem (s->cache.buf, s->cache.alloced); @@ -1397,7 +1397,7 @@ cdk_stream_kick_off (cdk_stream_t inp, cdk_stream_t out) if (!inp || !out) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } rc = CDK_Success; @@ -1440,7 +1440,7 @@ cdk_stream_mmap_part (cdk_stream_t s, off_t off, size_t len, if (!ret_buf || !ret_buflen) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } *ret_buf = NULL; @@ -1448,7 +1448,7 @@ cdk_stream_mmap_part (cdk_stream_t s, off_t off, size_t len, if (!s) { - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Value; } @@ -1456,7 +1456,7 @@ cdk_stream_mmap_part (cdk_stream_t s, off_t off, size_t len, if (s->cbs_hd) { _cdk_log_debug ("cdk_stream_mmap_part: not supported on callbacks\n"); - gnutls_assert(); + gnutls_assert (); return CDK_Inv_Mode; } @@ -1464,13 +1464,13 @@ cdk_stream_mmap_part (cdk_stream_t s, off_t off, size_t len, rc = cdk_stream_flush (s); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } rc = cdk_stream_seek (s, off); if (rc) { - gnutls_assert(); + gnutls_assert (); return rc; } if (!len) @@ -1478,12 +1478,12 @@ cdk_stream_mmap_part (cdk_stream_t s, off_t off, size_t len, if (!len) { _cdk_log_debug ("cdk_stream_mmap_part: invalid file size %lu\n", len); - gnutls_assert(); + gnutls_assert (); return s->error; } if (len > MAX_MAP_SIZE) { - gnutls_assert(); + gnutls_assert (); return CDK_Too_Short; } @@ -1494,7 +1494,7 @@ cdk_stream_mmap_part (cdk_stream_t s, off_t off, size_t len, *ret_buflen = n; rc = cdk_stream_seek (s, oldpos); if (rc) - gnutls_assert(); + gnutls_assert (); return rc; } |