asn1c | The ASN.1 Compiler - ASN | Cryptography library

 by   vlm C Version: v0.9.28 License: BSD-2-Clause

kandi X-RAY | asn1c Summary

kandi X-RAY | asn1c Summary

asn1c is a C library typically used in Security, Cryptography applications. asn1c has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

The ASN.1 Compiler
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              asn1c has a medium active ecosystem.
              It has 916 star(s) with 505 fork(s). There are 103 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 198 open issues and 143 have been closed. On average issues are closed in 87 days. There are 20 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of asn1c is v0.9.28

            kandi-Quality Quality

              asn1c has no bugs reported.

            kandi-Security Security

              asn1c has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              asn1c is licensed under the BSD-2-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              asn1c releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of asn1c
            Get all kandi verified functions for this library.

            asn1c Key Features

            No Key Features are available at this moment for asn1c.

            asn1c Examples and Code Snippets

            No Code Snippets are available at this moment for asn1c.

            Community Discussions

            QUESTION

            ASN1 and canonical octect encoding rules (COER) in Python
            Asked 2020-Sep-09 at 06:49

            I have some messages data structures represantations in ASN1. These messages have to sent using the canonical octect encoding rule (COER). I currently user asn1c for python,but, there is no support for coer. How could I create the instances and later do the encoding in python?

            ...

            ANSWER

            Answered 2020-Sep-05 at 19:51

            I'm afraid you might be in trouble. COER looks like it was standardised relatively recently (bearing in mind that ASN.1 is well over 30 years old), and I don't think that a lot of the tools have caught up yet.

            The tools from OSS Nokalva seem to support COER, but they don't do a Python binding, and their tools are quite pricey (but very good).

            For Python the "goto" has been the pyasn1 library, which doesn't seem to do COER (or even PER, which is a real pity).

            Objective Systems, which are also very good, now do a Python ASN.1 compiler(which trumps pyasn1's code first approach), but that doesn't yet do COER.

            The easiest thing might be whince, fork out for the OSS Nokalva tools, and use Iron Python to interop with their C# library and tools. That might seem an expensive way of doing it, but if your project is on a fixed timescale, that might be the lowest risk way of accomplishing what you want. You'd likely not be having to write any code to "do" COER, and instead you can concentrate on the application itself and avoid writing your own COER implementation that'd be a pain to maintain, and will eventually get surpassed by other ASN.1 tools anyway.

            Source https://stackoverflow.com/questions/63748743

            QUESTION

            ASN1 module compiled by asn1c fails to decode?
            Asked 2019-Nov-08 at 20:36

            I'm trying to parse RSA (private) keys using asn1c. I based the asn1 module on https://tools.ietf.org/html/rfc3447 and it looks as following (i tried to only use the private and public key part):

            ...

            ANSWER

            Answered 2019-Nov-08 at 20:36

            You need to compile with -fwide-types flag.

            -fwide-types Use the wide integer types (INTEGER_t, REAL_t) instead of ma-chine’s native data types (long, double).

            The problem is that most of the INTEGER fields of RSAPrivateKey contain really big numbers that not fit in long type that is being used by default.

            Without -fwide-types

            Source https://stackoverflow.com/questions/58353755

            QUESTION

            How to decode GSM-TCAP messages using asn1c generated code
            Asked 2019-Aug-26 at 12:16

            I am using the c code generated by asn1c from the TCAP protocol specification (i.e., the corresponding ASN1 files). I can successfully encode TCAP packets by the generated code. However, trying to "decode" related byte streams fails.

            A sample code is as follows.

            ...

            ANSWER

            Answered 2019-Aug-19 at 15:20

            I am using the c code generated by asn1c from the TCAP protocol specification

            Which asn1c are you using (git commit id) and where do you get it from as there are quite a log of forks out there?

            While the message type ("Begin", in this case), is correctly detected, but other paramters are not parsed.

            How do you know that Begin is correctly detected?

            Using other encoding rules, i.e., aper_decode() and uper_decode(), also fails.

            There is no point in trying other encodings as they are not binary compatible.

            I would be thankful if anyone can describe how to use the auto-generated c code for decoding (parsing) a byte string of TCAP messages.

            You are using it correctly and probably there is a bug somewhere in the BER decoder.

            You could try compiling with -DASN_EMIT_DEBUG=1 in CFLAGS (or -DEMIT_ASN_DEBUG=1 depending on the asn1c version you are using) to get some more debug messages.

            Source https://stackoverflow.com/questions/57506059

            QUESTION

            How to decode MAP Invoke messages using asn1c generated code
            Asked 2019-Aug-19 at 15:09

            I am using the c code generated by asn1c from the MAP protocol specification (i.e., the corresponding ASN1 files). Please consider the following sample code:

            ...

            ANSWER

            Answered 2019-Aug-19 at 15:09

            The invokeId and opCode parameters are truely detected, and the parser gives us a buffer named as invokeParameters which is of type ANY.

            The question is how to decode (parse) invokeParameters?

            You need to call ber_decode with the appropriate type (depending on the operation code) and the content of the ANY buffer. From ANY.h

            Source https://stackoverflow.com/questions/57533704

            QUESTION

            How to correctly use and free asn1c SEQUENCE_OF?
            Asked 2019-May-07 at 18:03

            I'm using the asn1c lib for many projects, but I never found how to use the free member of a SEQUENCE_OF. I always set it to nullptr because of that, and when I use Valgrind, I see (of course) that my lists members are not freed when using ASN_STRUCT_FREE on the element containing the list.

            So my question is how can I use that free member?

            Here is a simple example of how I use my lists with asn1c.

            ...

            ANSWER

            Answered 2019-May-07 at 18:03

            QUESTION

            Print human readable values for LDAP protocol fields in asn1c
            Asked 2018-Dec-17 at 18:13

            I use asn1c to parse the LDAP messages.

            For this purpose, after compiling the ASN.1 Definition defined in rfc4511, I use the ber_decode and xer_fprint functions for decoding and printing content in my program.

            For example, the two outputs indicated below are related to two different LDAP messages:

            ...

            ANSWER

            Answered 2018-Dec-15 at 17:48

            You cannot change LDAP asn1 specification to solve your problem.

            For example: when you decode a BindRequest, to decode name (of type LDAPDN) ber_decode expects the tag of OCTET STRING. If you change the spec as you suggest, you will expect the tag of UTF8String and receive the tag of OCTET STRING (hence the error)

            Unfortunately, with generic tools, there is no way to display a human readable text while the specification is using OCTET STRING

            Source https://stackoverflow.com/questions/53793882

            QUESTION

            Problem in compiling C code generated by osmocom asn1c
            Asked 2018-Dec-05 at 15:56

            I have installed the osmocom asn1c compiler, the aper-prefix branch, to obtain an implementation of the TCAP protocol. I have used the respective script to compile the ".asn" files. The C files are generated successfully, but when compiling the obtained C code, an error is raised, which is related to this line of code:

            ...

            ANSWER

            Answered 2018-Dec-05 at 15:56

            You have several options:

            1. Use a newer version of asn1c from this PR (still not merged)

            2. Copy the EXTERNAL.h from the osmocom repository

            3. Rename EXTERNAL to EXTERNALt in all asn files and add the following in the asn files that has EXTERNALt.

            Source https://stackoverflow.com/questions/53632962

            QUESTION

            Error in generating C code from GSM-TCAP asn1 files
            Asked 2018-Dec-05 at 04:06

            I am trying to generate C code for the GSM-TCAP asn1 files obtained from libosmo-asn1-TCAP. I have installed the osmocom libasnc1 compiler (tried both master and aper-prefix branches) and run this code:

            ...

            ANSWER

            Answered 2018-Dec-05 at 04:06

            You don't need to compile all asn files in asn sub-directory. There is a rebuild script that you could use.

            Source https://stackoverflow.com/questions/53612176

            QUESTION

            How to use asn.1 while transmit data in the internet?
            Asked 2018-Jan-26 at 15:29

            asn.1 = abstract syntax annotation one. I know it can define some types of data and by using asn1c compiler, we can convert Rectangle.asn to some of .c and .h files. Then we can encode or decode from or to different form of data(ber, per, xer, etc.) by using these .c and .h files. But how? I have a file named Rectangle.asn:

            ...

            ANSWER

            Answered 2018-Jan-26 at 15:29

            You need to read more about ASN.1.

            The problem that it solves is that things on different computers are not all the same. If you want to send data from an embedded x86 DOS system (16 bit little endian int) to a SPARC (32 bit big endian int) then you can't just use int on both sides.

            There are two main parts to ASN.1:

            • the language description i.e., the ASN.1 grammar
            • the encoding rules that apply the grammar to convert host data to and from encoded data

            There are some examples on the asn1c web site.

            Source https://stackoverflow.com/questions/48463901

            QUESTION

            Does the OpenSSL ASN.1 API support extensible types?
            Asked 2017-Nov-01 at 12:11

            I'm trying to use the OpenSSL ASN.1 API to implement my own custom types. I expect to extend these types in the future, and the ASN.1 standard itself supports this via the concept of extensible types (see here for an overview of what I want). However, I can't figure out if the OpenSSL ASN.1 API supports this concept and if so how to implement it. I've got the following structures defined using the macros supplied by OpenSSL:

            ...

            ANSWER

            Answered 2017-Nov-01 at 12:11

            Luke,

            You're probably going to have better luck with an actual ASN.1 compiler—there are several commercially available, but Lev Walkin's free ASN.1 Compiler might fit the bill for your needs.

            I'm not very familiar with OpenSSL, but a quick browse through the asn1t.h source (among others) doesn't suggest that there's builtin support for declaring an extensible sequence. You're probably more motivated than I to look, but I confess I wouldn't be surprised to find they didn't include it. Extensibility can be a hard problem to solve, especially if you're relying on preprocessor macros for code generation.

            In any case, relying on the OpenSSL code could cause problems in the future anyway: when the APIs or code change, you'll be forced to manually update all of your code to match. A code generator would (probably) do a better job of maintaining API (and ABI) compatibility while allowing somewhat more flexible code generation and language choices.

            Source https://stackoverflow.com/questions/46977200

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install asn1c

            If you haven't installed the asn1c yet, read the INSTALL.md file for a short installation guide.
            (also check out doc/asn1c-quick.pdf).

            Support

            For the list of asn1c command line options, see asn1c -h or man asn1c. The comprehensive documentation on this compiler is in doc/asn1c-usage.pdf. Please also read the FAQ file. An excellent book on ASN.1 is written by Olivier Dubuisson: "ASN.1 Communication between heterogeneous systems", ISBN:0-12-6333361-0.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/vlm/asn1c.git

          • CLI

            gh repo clone vlm/asn1c

          • sshUrl

            git@github.com:vlm/asn1c.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link