Added SILC Thread Queue API
[silc.git] / lib / silcasn1 / silcber.c
index 8f7b7e16bab1ef3877e64a152bf48cf026ff8ea9..e6f2de30a864ba1b55a9f968e4d8ec480e456562 100644 (file)
@@ -18,7 +18,7 @@
 */
 /* Basic Encoding Rules (BER) encoder and decoder. */
 
-#include "silcincludes.h"
+#include "silc.h"
 #include "silcber.h"
 
 /* Encodes a BER data block into the `ber', which must already have
@@ -28,9 +28,9 @@
    include the length of the data in the BER block. */
 
 SilcBool silc_ber_encode(SilcBuffer ber, SilcBerClass ber_class,
-                    SilcBerEncoding encoding, SilcUInt32 tag,
-                    const unsigned char *data, SilcUInt32 data_len,
-                    SilcBool indefinite)
+                        SilcBerEncoding encoding, SilcUInt32 tag,
+                        const unsigned char *data, SilcUInt32 data_len,
+                        SilcBool indefinite)
 {
   int i = 0, c;
   SilcUInt32 tmp;
@@ -75,7 +75,7 @@ SilcBool silc_ber_encode(SilcBuffer ber, SilcBerClass ber_class,
       /* Long form */
 
       /* Calculate the number of octets for the length field */
-      tmp = tag;
+      tmp = data_len;
       c = 0;
       while (tmp) {
        c++;
@@ -115,9 +115,9 @@ SilcBool silc_ber_encode(SilcBuffer ber, SilcBerClass ber_class,
    of the entire BER object is `identifier_len' + `data_len'. */
 
 SilcBool silc_ber_decode(SilcBuffer ber, SilcBerClass *ber_class,
-                    SilcBerEncoding *encoding, SilcUInt32 *tag,
-                    const unsigned char **data, SilcUInt32 *data_len,
-                    SilcBool *indefinite, SilcUInt32 *identifier_len)
+                        SilcBerEncoding *encoding, SilcUInt32 *tag,
+                        const unsigned char **data, SilcUInt32 *data_len,
+                        SilcBool *indefinite, SilcUInt32 *identifier_len)
 {
   int i = 0, c;
   SilcUInt32 t;