aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/c_src/asn1_erl_nif.c
AgeCommit message (Collapse)Author
2018-12-06Handle erroneous length during decode (BER only) without crashingKenneth Lundin
2018-08-02Fix NIF stack recursion bug and enforce a limitRaimo Niskanen
Fix recursion bug when decoding Constructed value within another value - here the allowed buffer for the recursed decode shall only be the size of the enclosing value, not the whole buffer. Return ASN1_ERROR if BER decode recurses more than about 8 kWords.
2017-05-04Update copyright yearRaimo Niskanen
2017-03-14asn1_erl_nif.c: Correct handling of tags >= 16384Björn Gustavsson
Tags number above 16383 were not decoded correctly in ber_decode_tag(). We could fix the problem, but there does not seem to be any need. First, the only way that high tag numbers can be created is with manual tagging; after 1994 manual tagging is no longer recommended. Second, the ASN.1 playground (http://asn1-playground.oss.com) only supports tags up to 16383 (the same is presumably true for OSS Nokalva's other tools). Therefore, clean up the existing code and make it an explicit 'invalid_tag' error when tags above 13383 are encountered (instead of an implicit 'wrong_tag' error).
2016-09-19Use more correct delimiters for erl_nif.h includeTuncer Ayaz
Anywhere but the beam sources we shouldn't #include "erl_nif.h", because what "erl_nif.h" does is: (1) fail to find it outside of -I dirs, (2) then treat it as if it was written like <erl_nif.h>. Using <erl_nif.h> skips (1). More information can be found in 6.10.2 of the C standard. Because the examples use "erl_nif.h", NIF projects in the Erlang ecosystem copy this verbatim and make the same mistake.
2016-03-15update copyright-yearHenrik Nord
2015-06-18Change license text to APLv2Bruce Yinhe
2014-09-29BER decoding: Don't allow primitives with indefinite lengthsBjörn Gustavsson
According to the BER encoding rules, only constructed values may have indefinite lengths. A primitive value must be encoded with a definite length. Reported-by: Simon Cornish
2014-08-11BER decoding: Improve error checking for indefinite lengthBjörn Gustavsson
When an indefinite length was given, the decoder could look beyond the end of the buffer for the 0,0 that signals the end of the value.
2014-02-24Added support for ENEA OSELukas Larsson
This port has support for both non-smp and smp. It contains a new way to do io checking in which erts_poll_wait receives the payload of the polled entity. This has implications for all linked-in drivers.
2013-08-21erts: Add option to include nifs staticallyLukas Larsson
Both crypto and asn1 are supported.
2013-02-07Merge branch 'maint'Björn Gustavsson
* maint: Prepare release Don't run testX420/1 on old slow Sparc systems testX420: Pass Options to the ASN.1 compiler asn1_erl_nif: Correct broken length encoding asn1_SUITE: Mend broken test_modified_x420/1 Revert "Prepare release" Conflicts: lib/asn1/doc/src/notes.xml lib/asn1/test/asn1_SUITE.erl
2013-02-04asn1_erl_nif: Correct broken length encodingBjörn Gustavsson
The ber_bin_v2 backend calls a NIF function to decode all tags and lengths. Even open types that should not be decoded will also be decoded, which makes it necessary to later re-encode the data using a NIF function. The NIF function incorrectly encoded lengths.
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-22BER: Correct bug in 'undec_rest'Björn Gustavsson
enif_make_new_binary() cannot return NULL, so while at it, remove the check for return value of enif_make_new_binary() being NULL.
2013-01-22Correct error handling for the NIF functionsBjörn Gustavsson
Also make sure that the error handling is contained within the asn1rt_nif module and does not leak out to generated code.
2012-02-29[asn1] Refactor test cases and remove extra suitesAdam Lindberg
2012-01-03asn1: Remove unused variable in asn1_erl_nif.cBjörn-Egil Dahlberg
2011-08-01Update to use enif_alloc instead of mallocLukas Larsson
2011-08-01Fix bug in counting length of empty composite typesLukas Larsson
2011-08-01Fix bug where composite types with more then one element would be encoded in ↵Lukas Larsson
reverse
2011-08-01Update ber encode nif to use a linked list memry bufferLukas Larsson
The encoded ber binary is now a linked list of memory buffers which is written to from the back while allocating more segments as needed
2011-08-01Create a nif for ber encodeLukas Larsson
2011-08-01Update tag to be ints instead of longsLukas Larsson
This is in order to circumvent a bug in enif_make_ulong in R14B03 for halfword
2011-08-01Update asn1 nif to handle calls with an empty binaryLukas Larsson
2011-08-01Cannot be a binary as decode creates tuplesLukas Larsson
2011-08-01return 0 as error code when an unknown error happensLukas Larsson
2011-08-01Add load, upgrade and purge functions for asn1 nifsLukas Larsson
2011-08-01Add better error messages to nifsLukas Larsson
2011-08-01Add asn1 nif for ber decode and per encodeLukas Larsson