apps/agl-service-can-low-level.git
9 years agoAdd int_size option for generator.
Petteri Aimonen [Sun, 4 Jan 2015 09:36:42 +0000 (11:36 +0200)]
Add int_size option for generator.

This allows overriding the integer field types to e.g. uint8_t for
saving RAM.

Update issue 139
Status: FixedInGit

9 years agoChange PB_RETURN_ERROR() macro to avoid compiler warnings.
Petteri Aimonen [Sat, 3 Jan 2015 08:59:19 +0000 (10:59 +0200)]
Change PB_RETURN_ERROR() macro to avoid compiler warnings.

Update issue 140
Status: FixedInGit

9 years agoFix build failure due to missing dependency in SConscript
Petteri Aimonen [Fri, 26 Dec 2014 22:37:59 +0000 (00:37 +0200)]
Fix build failure due to missing dependency in SConscript

9 years agoFix memory leaks with PB_ENABLE_MALLOC and certain submessage type combinations.
Petteri Aimonen [Fri, 26 Dec 2014 21:14:39 +0000 (23:14 +0200)]
Fix memory leaks with PB_ENABLE_MALLOC and certain submessage type combinations.

There was a memory leak when:

1) A statically allocated submessage or
2) an extension field submessage

contained

A) a pointer-type field or
B) a submessage that further contained a pointer-type field.

This was because pb_release() didn't recurse into non-pointer fields.

Update issue 138
Status: FixedInGit

9 years agoInitialize also extension fields to defaults in pb_decode().
Petteri Aimonen [Fri, 26 Dec 2014 21:13:07 +0000 (23:13 +0200)]
Initialize also extension fields to defaults in pb_decode().

This makes the behaviour more consistent with non-extension fields,
and also makes sure that all 'found' fields of extensions are initially
false.

9 years agoFix bug in backwards_compatibility test case.
Petteri Aimonen [Fri, 26 Dec 2014 21:03:04 +0000 (23:03 +0200)]
Fix bug in backwards_compatibility test case.

The memset() filled also the extensions field, which was just
waiting for a crash to happen.

9 years agoAdd testcase for releasing memory in submessages/extensions
Petteri Aimonen [Fri, 26 Dec 2014 16:24:23 +0000 (18:24 +0200)]
Add testcase for releasing memory in submessages/extensions

9 years agoAdd support for POINTER type in extensions
Petteri Aimonen [Fri, 26 Dec 2014 16:23:36 +0000 (18:23 +0200)]
Add support for POINTER type in extensions

9 years agoInclude the field type in a comment for extension fields
Petteri Aimonen [Fri, 26 Dec 2014 15:43:38 +0000 (17:43 +0200)]
Include the field type in a comment for extension fields

9 years agoMove malloc support to tests/common directory
Petteri Aimonen [Fri, 26 Dec 2014 15:34:45 +0000 (17:34 +0200)]
Move malloc support to tests/common directory

9 years agoMove malloc_wrappers.c to tests/common
Petteri Aimonen [Fri, 26 Dec 2014 15:08:17 +0000 (17:08 +0200)]
Move malloc_wrappers.c to tests/common

9 years agoVerify build with protobuf-3.0.0, fix problems.
Petteri Aimonen [Mon, 22 Dec 2014 20:52:36 +0000 (22:52 +0200)]
Verify build with protobuf-3.0.0, fix problems.

Also updated descriptor.proto from protobuf-3.0.0.

9 years agoAdd compilation option to disable struct packing.
Petteri Aimonen [Mon, 22 Dec 2014 18:52:40 +0000 (20:52 +0200)]
Add compilation option to disable struct packing.

Update issue 136
Status: FixedInGit

9 years agoSet version to nanopb-0.3.2-dev
Petteri Aimonen [Tue, 16 Sep 2014 17:41:45 +0000 (20:41 +0300)]
Set version to nanopb-0.3.2-dev

9 years agoPublishing nanopb-0.3.1
Petteri Aimonen [Thu, 11 Sep 2014 16:36:14 +0000 (19:36 +0300)]
Publishing nanopb-0.3.1

9 years agoUpdate changelog
Petteri Aimonen [Thu, 11 Sep 2014 16:26:32 +0000 (19:26 +0300)]
Update changelog

9 years agoAdd a fuzz testing stub for ability to use external generators also
Petteri Aimonen [Thu, 11 Sep 2014 14:58:53 +0000 (17:58 +0300)]
Add a fuzz testing stub for ability to use external generators also

9 years agoProtect against size_t overflows in pb_dec_bytes/pb_dec_string.
Petteri Aimonen [Mon, 8 Sep 2014 14:34:16 +0000 (17:34 +0300)]
Protect against size_t overflows in pb_dec_bytes/pb_dec_string.

Possible consequences of bug:
1) Denial of service by causing a crash
   Possible when all of the following apply:
      - Untrusted data is passed to pb_decode()
      - The top-level message contains a static string field as the first field.
   Causes a single write of '0' byte to 1 byte before the message struct.

2) Remote code execution
   Possible when all of the following apply:
      - 64-bit platform
      - The message or a submessage contains a static/pointer string field.
      - Decoding directly from a custom pb_istream_t
      - bytes_left on the stream is set to larger than 4 GB
   Causes a write of up to 4 GB of data past the string field.

3) Possible heap corruption or remote code execution
   Possible when all of the following apply:
      - less than 64-bit platform
      - The message or a submessage contains a pointer-type bytes field.
   Causes a write of sizeof(pb_size_t) bytes of data past a 0-byte long
   malloc()ed buffer. On many malloc() implementations, this causes at
   most a crash. However, remote code execution through a controlled jump
   cannot be ruled out.

--

Detailed analysis follows

In the following consideration, I define "platform bitness" as equal to
number of bits in size_t datatype. Therefore most 8-bit platforms are
regarded as 16-bit for the purposes of this discussion.

1. The overflow in pb_dec_string

The overflow happens in this computation:

uint32_t size;
size_t alloc_size;
alloc_size = size + 1;

There are two ways in which the overflow can occur: In the uint32_t
addition, or in the cast to size_t. This depends on the platform
bitness.

On 32- and 64-bit platforms, the size has to be UINT32_MAX for the
overflow to occur. In that case alloc_size will be 0.

On 16-bit platforms, overflow will happen whenever size is more than
UINT16_MAX, and resulting alloc_size is attacker controlled.

For static fields, the alloc_size value is just checked against the
field data size. For pointer fields, the alloc_size value is passed to
malloc(). End result in both cases is the same, the storage is 0 or
just a few bytes in length.

On 16-bit platforms, another overflow occurs in the call to pb_read(),
when passing the original size. An attacker will want the passed value
to be larger than the alloc_size, therefore the only reasonable choice
is to have size = UINT16_MAX and alloc_size = 0. Any larger multiple
will truncate to the same values.

At this point we have read atleast the tag and the string length of the
message, i.e. atleast 3 bytes. The maximum initial value for stream
bytes_left is SIZE_MAX, thus at this point at most SIZE_MAX-3 bytes are
remaining.

On 32-bit and 16-bit platforms this means that the size passed to
pb_read() is always larger than the number of remaining bytes. This
causes pb_read() to fail immediately, before reading any bytes.

On 64-bit platforms, it is possible for the bytes_left value to be set
to a value larger than UINT32_MAX, which is the wraparound point in
size calculation. In this case pb_read() will succeed and write up to 4
GB of attacker controlled data over the RAM that comes after the string
field.

On all platforms, there is an unconditional write of a terminating null
byte. Because the size of size_t typically reflects the size of the
processor address space, a write at UINT16_MAX or UINT32_MAX bytes
after the string field actually wraps back to before the string field.
Consequently, on 32-bit and 16-bit platforms, the bug causes a single
write of '0' byte at one byte before the string field.

If the string field is in the middle of a message, this will just
corrupt other data in the message struct. Because the message contents
is attacker controlled anyway, this is a non-issue. However, if the
string field is the first field in the top-level message, it can
corrupt other data on the stack/heap before it. Typically a single '0'
write at a location not controlled by attacker is enough only for a
denial-of-service attack.

When using pointer fields and malloc(), the attacker controlled
alloc_size will cause a 0-size allocation to happen. By the same logic
as before, on 32-bit and 16-bit platforms this causes a '0' byte write
only. On 64-bit platforms, however, it will again allow up to 4 GB of
malicious data to be written over memory, if the stream length allows
the read.

2. The overflow in pb_dec_bytes

This overflow happens in the PB_BYTES_ARRAY_T_ALLOCSIZE macro:

The computation is done in size_t data type this time. This means that
an overflow is possible only when n is larger than SIZE_MAX -
offsetof(..). The offsetof value in this case is equal to
sizeof(pb_size_t) bytes.

Because the incoming size value is limited to 32 bits, no overflow can
happen here on 64-bit platforms.

The size will be passed to pb_read(). Like before, on 32-bit and 16-bit
platforms the read will always fail before writing anything.

This leaves only the write of bdest->size as exploitable. On statically
allocated fields, the size field will always be allocated, regardless
of alloc_size. In this case, no buffer overflow is possible here, but
user code could possibly use the attacker controlled size value and
read past a buffer.

If the field is allocated through malloc(), this will allow a write of
sizeof(pb_size_t) attacker controlled bytes to past a 0-byte long
buffer. In typical malloc implementations, this will either fit in
unused alignment padding area, or cause a heap corruption and a crash.
Under very exceptional situation it could allow attacker to influence
the behaviour of malloc(), possibly jumping into an attacker-controlled
location and thus leading to remote code execution.

9 years agoAdd just-to-be-sure check to allocate_field().
Petteri Aimonen [Mon, 8 Sep 2014 14:33:05 +0000 (17:33 +0300)]
Add just-to-be-sure check to allocate_field().

This check will help to detect bugs earlier, and is quite lightweight
compared to malloc() anyway.

9 years agoFix memory leak with duplicated fields and PB_ENABLE_MALLOC.
Petteri Aimonen [Sat, 6 Sep 2014 15:56:34 +0000 (18:56 +0300)]
Fix memory leak with duplicated fields and PB_ENABLE_MALLOC.

If a required or optional field appeared twice in the message data,
pb_decode will overwrite the old data with new one. That is fine, but
with submessage fields, it didn't release the allocated subfields before
overwriting.

This bug can manifest if all of the following conditions are true:

1. There is a message with a "optional" or "required" submessage field
   that has type:FT_POINTER.

2. The submessage contains atleast one field with type:FT_POINTER.

3. The message data to be decoded has the submessage field twice in it.

9 years agoFix crash in pb_release() if called twice on same message.
Petteri Aimonen [Sat, 6 Sep 2014 15:21:58 +0000 (18:21 +0300)]
Fix crash in pb_release() if called twice on same message.

There was a double-free bug in pb_release() because it didn't set size fields
to zero after deallocation. Most commonly this happens if pb_decode() fails,
internally calls pb_release() and then application code also calls pb_release().

9 years agoAdd a better fuzz test.
Petteri Aimonen [Sat, 6 Sep 2014 16:01:11 +0000 (19:01 +0300)]
Add a better fuzz test.

Attempts to verify all the properties defined in the security model,
while also being portable and able to run on many platforms.

9 years agoAdd test case for simulated io errors.
Petteri Aimonen [Sun, 7 Sep 2014 17:31:36 +0000 (20:31 +0300)]
Add test case for simulated io errors.

Update issue 126
Status: FixedInGit

9 years agoAdd a few missing unit tests
Petteri Aimonen [Sun, 7 Sep 2014 16:49:26 +0000 (19:49 +0300)]
Add a few missing unit tests

9 years agoFix compilation error with generated initializers for repeated pointer fields
Petteri Aimonen [Sun, 7 Sep 2014 16:49:00 +0000 (19:49 +0300)]
Fix compilation error with generated initializers for repeated pointer fields

9 years agoCode coverage results were ignoring the data from encode/decode unittests.
Petteri Aimonen [Sun, 7 Sep 2014 16:25:09 +0000 (19:25 +0300)]
Code coverage results were ignoring the data from encode/decode unittests.

Update issue 126
Status: Started

9 years agoUpdate security model with regards to pointer fields
Petteri Aimonen [Thu, 4 Sep 2014 18:19:54 +0000 (21:19 +0300)]
Update security model with regards to pointer fields

9 years agoFix cyclic messages support in generator. Beginnings of test.
Petteri Aimonen [Thu, 28 Aug 2014 18:23:28 +0000 (21:23 +0300)]
Fix cyclic messages support in generator. Beginnings of test.

Update issue 130
Status: Started

9 years agoAdd missing * in migration docs
Petteri Aimonen [Tue, 26 Aug 2014 15:22:13 +0000 (18:22 +0300)]
Add missing * in migration docs

9 years agoSetting version to 0.3.1-dev
Petteri Aimonen [Tue, 26 Aug 2014 15:20:48 +0000 (18:20 +0300)]
Setting version to 0.3.1-dev

9 years agoPublishing nanopb-0.3.0
Petteri Aimonen [Tue, 26 Aug 2014 15:08:31 +0000 (18:08 +0300)]
Publishing nanopb-0.3.0

9 years agoUpdate changelog
Petteri Aimonen [Tue, 26 Aug 2014 15:08:01 +0000 (18:08 +0300)]
Update changelog

9 years agoAdd pb_common.c to examples
Petteri Aimonen [Tue, 26 Aug 2014 15:05:10 +0000 (18:05 +0300)]
Add pb_common.c to examples

9 years agoAdd #if guard for .pb.h version.
Petteri Aimonen [Tue, 19 Aug 2014 14:55:44 +0000 (17:55 +0300)]
Add #if guard for .pb.h version.

The version in PB_PROTO_HEADER_VERSION can be bumped whenever there
is a breaking change to the generated files, and it will then alert
to the difference.

Update issue 129
Status: FixedInGit

9 years agoRename poorly named identifier to avoid name conflicts.
Petteri Aimonen [Mon, 18 Aug 2014 18:11:10 +0000 (21:11 +0300)]
Rename poorly named identifier to avoid name conflicts.

Update issue 106
Status: FixedInGit

9 years agoRename UNUSED() and STATIC_ASSERT() macros with PB_ prefix.
Petteri Aimonen [Mon, 18 Aug 2014 17:49:48 +0000 (20:49 +0300)]
Rename UNUSED() and STATIC_ASSERT() macros with PB_ prefix.

This avoids possible namespace conflicts with other macros.

9 years agoChange the _count fields to use pb_size_t datatype.
Petteri Aimonen [Mon, 18 Aug 2014 17:09:52 +0000 (20:09 +0300)]
Change the _count fields to use pb_size_t datatype.

Update issue 82
Status: FixedInGit

9 years agoFix windows build error in tests
Petteri Aimonen [Sun, 10 Aug 2014 14:44:27 +0000 (17:44 +0300)]
Fix windows build error in tests

9 years agoAdd document detailing migration from old versions
Petteri Aimonen [Sun, 10 Aug 2014 14:40:17 +0000 (17:40 +0300)]
Add document detailing migration from old versions

9 years agoSwitch pb_encode to use the common iterator logic in pb_common.c
Petteri Aimonen [Sun, 10 Aug 2014 10:01:09 +0000 (13:01 +0300)]
Switch pb_encode to use the common iterator logic in pb_common.c

Update issue 128
Status: FixedInGit

9 years agoSeparate field iterator logic from pb_decode to pb_common.
Petteri Aimonen [Sun, 10 Aug 2014 09:42:01 +0000 (12:42 +0300)]
Separate field iterator logic from pb_decode to pb_common.

9 years agoSetting version to 0.3.0-dev
Petteri Aimonen [Sat, 9 Aug 2014 19:18:24 +0000 (22:18 +0300)]
Setting version to 0.3.0-dev

9 years agoPublishing nanopb-0.2.9
Petteri Aimonen [Sat, 9 Aug 2014 19:01:04 +0000 (22:01 +0300)]
Publishing nanopb-0.2.9

9 years agoUpdate changelog
Petteri Aimonen [Mon, 4 Aug 2014 16:13:39 +0000 (19:13 +0300)]
Update changelog

9 years agoGenerate #defines for initializing message structures.
Petteri Aimonen [Mon, 4 Aug 2014 15:40:40 +0000 (18:40 +0300)]
Generate #defines for initializing message structures.

Usage like:
MyMessage foo = MyMessage_init_default;

MyMessage_init_default will initialize to default values defined in .proto.

MyMessage_init_zero will initialize to null/zero values. Same results as {}
or {0}, but will avoid compiler warnings by initializing everything explicitly.

Update issue 79
Status: FixedInGit

9 years agoAdd skip_message option to generator.
Petteri Aimonen [Sun, 20 Jul 2014 11:56:12 +0000 (14:56 +0300)]
Add skip_message option to generator.

Update issue 121
Status: FixedInGit

9 years agoAdd support for inverted patterns in test framework.
Petteri Aimonen [Sun, 20 Jul 2014 11:55:47 +0000 (14:55 +0300)]
Add support for inverted patterns in test framework.

9 years agoCleanup and comment the code of network_server example.
Petteri Aimonen [Sun, 20 Jul 2014 11:44:41 +0000 (14:44 +0300)]
Cleanup and comment the code of network_server example.

Update issue 123
Status: FixedInGit

9 years agoDo not automatically add a dot with generator -e option.
Petteri Aimonen [Sun, 20 Jul 2014 11:25:11 +0000 (14:25 +0300)]
Do not automatically add a dot with generator -e option.

Now -e option in generator is more versatile. Especially it avoids
double-dot problem with some build systems.

Given foobar.proto, we now get:
-e .pb  =>  foobar.pb.c (default)
-e _pb  =>  foobar_pb.c
-e ''   =>  foobar.c

Note that if you have used -e option previously, you will have to prepend
. to the argument to get the same filenames as before.

Update issue 122
Status: FixedInGit

9 years agoGive better messages about the .options file path.
Petteri Aimonen [Sun, 20 Jul 2014 11:10:47 +0000 (14:10 +0300)]
Give better messages about the .options file path.

Update issue 124
Status: FixedInGit

9 years agoFix problem with .options file and extension fields.
Petteri Aimonen [Sun, 20 Jul 2014 11:02:56 +0000 (14:02 +0300)]
Fix problem with .options file and extension fields.

The options for an extension field were being looked up under wrong name
(MessageName instead of MessageName.fieldname).

Fixed the problem and added regression test. Created a new subfolder for
regression test cases.

Update issue 125
Status: FixedInGit

10 years agoAdd unit tests for allocate_field().
Petteri Aimonen [Mon, 2 Jun 2014 18:20:57 +0000 (21:20 +0300)]
Add unit tests for allocate_field().

10 years agoMake clearer that size = 0 in allocate_field() is not allowed.
Petteri Aimonen [Mon, 2 Jun 2014 18:12:38 +0000 (21:12 +0300)]
Make clearer that size = 0 in allocate_field() is not allowed.

Back in design phase the code used realloc() for freeing the memory
also. However, this is not entirely portable, and therefore the finished
implementation used free() separately.

There were some remnants of the size = 0 code in the allocate_field()
code, which made it somewhat confusing. This change makes it clearer
that size = 0 is not allowed (and not used by nanopb).

10 years agoDon't use SIZE_MAX macro, as it is not in C89.
Petteri Aimonen [Mon, 2 Jun 2014 18:09:06 +0000 (21:09 +0300)]
Don't use SIZE_MAX macro, as it is not in C89.

Update issue 120
Status: FixedInGit

10 years agoAdd PB_PACKED_STRUCT support for Keil MDK-ARM toolchain
Petteri Aimonen [Fri, 30 May 2014 10:45:48 +0000 (13:45 +0300)]
Add PB_PACKED_STRUCT support for Keil MDK-ARM toolchain

Patch from Jon Read.

Update issue 119
Status: FixedInGit

10 years agoSetting version to 0.2.9-dev
Petteri Aimonen [Tue, 20 May 2014 16:52:09 +0000 (19:52 +0300)]
Setting version to 0.2.9-dev

10 years agoUpdate changelog for 0.2.8
Petteri Aimonen [Tue, 20 May 2014 16:46:48 +0000 (19:46 +0300)]
Update changelog for 0.2.8

10 years agoPublishing nanopb-0.2.8
Petteri Aimonen [Tue, 20 May 2014 16:34:28 +0000 (19:34 +0300)]
Publishing nanopb-0.2.8

10 years agoFix bug in alltypes test case that made fuzzing difficult.
Petteri Aimonen [Sat, 17 May 2014 17:28:33 +0000 (20:28 +0300)]
Fix bug in alltypes test case that made fuzzing difficult.

10 years agoFix security issue with PB_ENABLE_MALLOC.
Petteri Aimonen [Sat, 17 May 2014 17:06:55 +0000 (20:06 +0300)]
Fix security issue with PB_ENABLE_MALLOC.

The multiplication in allocate_field could potentially overflow,
leading to allocating too little memory. This could subsequently
allow an attacker to cause a write past the buffer, overwriting
other memory contents.

The attack is possible if untrusted message data is decoded using
nanopb, and the message type includes a pointer-type string or bytes
field, or a repeated numeric field. Submessage fields are not
affected.

This issue only affects systems that have been compiled with
PB_ENABLE_MALLOC enabled. Only version nanopb-0.2.7 is affected,
as prior versions do not include this functionality.

Update issue 117
Status: FixedInGit

10 years agoDocs update, remove malloc from limitations list
Petteri Aimonen [Sat, 26 Apr 2014 17:11:54 +0000 (20:11 +0300)]
Docs update, remove malloc from limitations list

10 years agoAdd option to not add timestamps to .pb.h and .pb.c preambles.
Petteri Aimonen [Fri, 18 Apr 2014 12:40:40 +0000 (15:40 +0300)]
Add option to not add timestamps to .pb.h and .pb.c preambles.

Patch by rusnakp.

Update issue 115
Status: FixedInGit

10 years agoFix typos in scons command line options
Petteri Aimonen [Tue, 15 Apr 2014 17:30:50 +0000 (20:30 +0300)]
Fix typos in scons command line options

10 years agoRemove -O0 from tests CFLAGS so that optimized builds can be tested also
Petteri Aimonen [Tue, 15 Apr 2014 17:27:38 +0000 (20:27 +0300)]
Remove -O0 from tests CFLAGS so that optimized builds can be tested also

10 years agoFix bug in missing_fields test case
Petteri Aimonen [Wed, 9 Apr 2014 16:39:12 +0000 (19:39 +0300)]
Fix bug in missing_fields test case

10 years agoUse -fsanitize=undefined when running tests with clang
Petteri Aimonen [Wed, 9 Apr 2014 16:28:57 +0000 (19:28 +0300)]
Use -fsanitize=undefined when running tests with clang

10 years agoSetting version to 0.2.8-dev
Petteri Aimonen [Mon, 7 Apr 2014 17:45:04 +0000 (20:45 +0300)]
Setting version to 0.2.8-dev

10 years agoPublishing nanopb-0.2.7
Petteri Aimonen [Mon, 7 Apr 2014 17:30:42 +0000 (20:30 +0300)]
Publishing nanopb-0.2.7

10 years agoUpdate changelog
Petteri Aimonen [Mon, 7 Apr 2014 17:30:12 +0000 (20:30 +0300)]
Update changelog

10 years agoAdd rule for building coverage summary using lcov.
Petteri Aimonen [Sat, 5 Apr 2014 10:26:37 +0000 (13:26 +0300)]
Add rule for building coverage summary using lcov.

Also modified a few tests to be more compatible with coverage information,
so that they use the same pb_encode/decode.c instead of making a copy.

10 years agoFix unused parameter warning when building without errmsg.
Petteri Aimonen [Sat, 5 Apr 2014 10:25:44 +0000 (13:25 +0300)]
Fix unused parameter warning when building without errmsg.

10 years agoAdd a convenience function pb_get_encoded_size()
Petteri Aimonen [Sat, 5 Apr 2014 08:26:39 +0000 (11:26 +0300)]
Add a convenience function pb_get_encoded_size()

There is minimal size penalty from this, and it is probably much more
intuitive to use than PB_OSTREAM_SIZING itself.

This has been suggested before also, but I ended up refusing it back
them. Reconsidering it now, I see that an intuitive API is much better
than any amount of documentation explaining a non-intuitive API.

Update issue 16
Status: FixedInGit

10 years agoAdd a 'found' field to pb_extension_t.
Petteri Aimonen [Sat, 5 Apr 2014 08:11:05 +0000 (11:11 +0300)]
Add a 'found' field to pb_extension_t.

Update issue 112
Status: FixedInGit

10 years agoAdd some missing 'static' specifiers
Petteri Aimonen [Wed, 2 Apr 2014 18:08:15 +0000 (21:08 +0300)]
Add some missing 'static' specifiers

Update issue 91
Status: FixedInGit

10 years agoFix splint warnings, add splint test case
Petteri Aimonen [Wed, 2 Apr 2014 17:59:01 +0000 (20:59 +0300)]
Fix splint warnings, add splint test case

10 years agoFix compile error when default value given for extension field.
Petteri Aimonen [Tue, 1 Apr 2014 13:47:53 +0000 (16:47 +0300)]
Fix compile error when default value given for extension field.

Update issue 111
Status: FixedInGit

10 years agoAdd stdlib.h to pb_syshdr.h for dynamic allocation
Petteri Aimonen [Tue, 18 Mar 2014 14:13:54 +0000 (16:13 +0200)]
Add stdlib.h to pb_syshdr.h for dynamic allocation

10 years agoMore configuration options for dynamic alloc
Petteri Aimonen [Mon, 17 Mar 2014 15:25:58 +0000 (17:25 +0200)]
More configuration options for dynamic alloc

10 years agoDocumentation updates
Petteri Aimonen [Sun, 16 Mar 2014 13:52:19 +0000 (15:52 +0200)]
Documentation updates

10 years agoFinish the alltypes_pointer testcase, use valgrind if available.
Petteri Aimonen [Sat, 15 Mar 2014 07:39:27 +0000 (09:39 +0200)]
Finish the alltypes_pointer testcase, use valgrind if available.

10 years agoGet rid of pb_bytes_ptr_t, just allocate pb_bytes_array_t dynamically.
Petteri Aimonen [Sat, 15 Mar 2014 06:45:58 +0000 (08:45 +0200)]
Get rid of pb_bytes_ptr_t, just allocate pb_bytes_array_t dynamically.

This makes the internal logic much simpler, and also keeps the datatypes
more similar between STATIC/POINTER cases. It will still be a bit cumbersome
to use because of variable length array member. Macros PB_BYTES_ARRAY_T(n) and
PB_BYTES_ARRAY_T_ALLOCSIZE(n) have been added to make life a bit easier.

This has the drawback that it is no longer as easy to use externally allocated
byte array as input for bytes field in pointer mode. However, this is still
easy to do using callbacks, so it shouldn't be a large issue.

10 years agoAdd pb_release() function
Petteri Aimonen [Wed, 12 Mar 2014 19:08:35 +0000 (21:08 +0200)]
Add pb_release() function

10 years agoMore fixes for dynamic allocation
Petteri Aimonen [Mon, 10 Mar 2014 16:19:38 +0000 (18:19 +0200)]
More fixes for dynamic allocation

10 years agoBugfixes for dynamic allocation
Petteri Aimonen [Tue, 25 Feb 2014 17:58:11 +0000 (19:58 +0200)]
Bugfixes for dynamic allocation

10 years agoBeginnings of malloc support in pb_decode
Petteri Aimonen [Mon, 24 Feb 2014 19:09:25 +0000 (21:09 +0200)]
Beginnings of malloc support in pb_decode

10 years agoSetting version to 0.2.7-dev
Petteri Aimonen [Sat, 15 Feb 2014 15:15:54 +0000 (17:15 +0200)]
Setting version to 0.2.7-dev

10 years agoPublishing nanopb-0.2.6
Petteri Aimonen [Sat, 15 Feb 2014 14:40:38 +0000 (16:40 +0200)]
Publishing nanopb-0.2.6

10 years agoUpdate changelog
Petteri Aimonen [Wed, 12 Feb 2014 17:50:52 +0000 (19:50 +0200)]
Update changelog

10 years agoMove descriptor.proto to google/protobuf directory where it belongs.
Petteri Aimonen [Wed, 12 Feb 2014 17:43:04 +0000 (19:43 +0200)]
Move descriptor.proto to google/protobuf directory where it belongs.

This fixes some interoperability problems when trying to compile
nanopb.proto for e.g. the Google's C++ library.

Update issue 104
Status: FixedInGit

10 years agoAdd test case for package names defined in .proto file.
Petteri Aimonen [Wed, 12 Feb 2014 17:22:01 +0000 (19:22 +0200)]
Add test case for package names defined in .proto file.

10 years agoImprove status/error reporting in generator.
Petteri Aimonen [Wed, 12 Feb 2014 16:51:48 +0000 (18:51 +0200)]
Improve status/error reporting in generator.

Update issue 105
Status: FixedInGit

10 years agoAdd AllTypes decoding test with callbacks.
Petteri Aimonen [Mon, 10 Feb 2014 19:00:26 +0000 (21:00 +0200)]
Add AllTypes decoding test with callbacks.

Update issue 99
Status: FixedInGit

10 years agoAdd AllTypes encoding test for callbacks (issue #99)
Petteri Aimonen [Sun, 9 Feb 2014 17:28:50 +0000 (19:28 +0200)]
Add AllTypes encoding test for callbacks (issue #99)

Still need to do the decoding side.

10 years agoExtreme negative integer constants are a bit nasty to define in C, just avoid the...
Petteri Aimonen [Wed, 5 Feb 2014 15:56:37 +0000 (17:56 +0200)]
Extreme negative integer constants are a bit nasty to define in C, just avoid the trouble in tests for now.

10 years agoAdd coments to places where STATIC_ASSERT is used.
Petteri Aimonen [Tue, 4 Feb 2014 18:34:57 +0000 (20:34 +0200)]
Add coments to places where STATIC_ASSERT is used.

Update issue 96
Status: FixedInGit

10 years agoAdd proper suffixes for integer default values.
Petteri Aimonen [Tue, 4 Feb 2014 18:24:44 +0000 (20:24 +0200)]
Add proper suffixes for integer default values.

Update issue 102
Status: FixedInGit

10 years agoAdd strict-aliasing GCC warnings for core
Petteri Aimonen [Tue, 4 Feb 2014 18:11:52 +0000 (20:11 +0200)]
Add strict-aliasing GCC warnings for core

10 years agoFix problem with callback-type fields (issue #99).
Petteri Aimonen [Fri, 3 Jan 2014 09:17:39 +0000 (11:17 +0200)]
Fix problem with callback-type fields (issue #99).

10 years agoSetting version to 0.2.6-dev
Petteri Aimonen [Wed, 1 Jan 2014 09:44:47 +0000 (11:44 +0200)]
Setting version to 0.2.6-dev

10 years agoPublishing nanopb-0.2.5
Petteri Aimonen [Wed, 1 Jan 2014 09:11:19 +0000 (11:11 +0200)]
Publishing nanopb-0.2.5