X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcasn1%2Fsilcber.c;h=e6f2de30a864ba1b55a9f968e4d8ec480e456562;hb=e7b6c157b80152bf9fb9266e6bdd93f9fb0db776;hp=bfcafa37b5e276f0f3e560c08e7eab95569123de;hpb=0f0340b9fbce9704cc7171f8f0104ce9103d2de6;p=silc.git diff --git a/lib/silcasn1/silcber.c b/lib/silcasn1/silcber.c index bfcafa37..e6f2de30 100644 --- a/lib/silcasn1/silcber.c +++ b/lib/silcasn1/silcber.c @@ -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 @@ -27,10 +27,10 @@ function. If the `indefinite' is TRUE then the BER block will not include the length of the data in the BER block. */ -bool silc_ber_encode(SilcBuffer ber, SilcBerClass ber_class, - SilcBerEncoding encoding, SilcUInt32 tag, - const unsigned char *data, SilcUInt32 data_len, - bool indefinite) +SilcBool silc_ber_encode(SilcBuffer ber, SilcBerClass ber_class, + SilcBerEncoding encoding, SilcUInt32 tag, + const unsigned char *data, SilcUInt32 data_len, + SilcBool indefinite) { int i = 0, c; SilcUInt32 tmp; @@ -75,7 +75,7 @@ bool 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++; @@ -114,10 +114,10 @@ bool silc_ber_encode(SilcBuffer ber, SilcBerClass ber_class, `identifier_len' is the length of the BER header, and the length of the entire BER object is `identifier_len' + `data_len'. */ -bool silc_ber_decode(SilcBuffer ber, SilcBerClass *ber_class, - SilcBerEncoding *encoding, SilcUInt32 *tag, - const unsigned char **data, SilcUInt32 *data_len, - bool *indefinite, SilcUInt32 *identifier_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) { int i = 0, c; SilcUInt32 t; @@ -240,7 +240,7 @@ bool silc_ber_decode(SilcBuffer ber, SilcBerClass *ber_class, encoding with silc_ber_encode. */ SilcUInt32 silc_ber_encoded_len(SilcUInt32 tag, SilcUInt32 data_len, - bool indefinite) + SilcBool indefinite) { SilcUInt32 len, tmp;