Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
8ac149d3
Commit
8ac149d3
authored
Jul 07, 2020
by
Mouse
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into vlm_master
parents
dbd0ed09
00fa516f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
14 deletions
+76
-14
AUTHORS
AUTHORS
+2
-0
libasn1compiler/asn1c_constraint.c
libasn1compiler/asn1c_constraint.c
+4
-1
skeletons/NULL.c
skeletons/NULL.c
+61
-3
skeletons/NULL.h
skeletons/NULL.h
+4
-5
skeletons/file-dependencies
skeletons/file-dependencies
+1
-1
tests/tests-asn1c-compiler/155-parameterization-more-than-two-level-OK.asn1.-Pgen-PER
...55-parameterization-more-than-two-level-OK.asn1.-Pgen-PER
+2
-2
tests/tests-asn1c-compiler/42-real-life-OK.asn1.-PR
tests/tests-asn1c-compiler/42-real-life-OK.asn1.-PR
+2
-2
No files found.
AUTHORS
View file @
8ac149d3
Full list of copyright holders:
Rob Stradling <rob@sectigo.com>
Bartosz Marcinkiewicz <bma@megawatt.com.pl>
Bent Nicolaisen <BN@JAI.com>
Bi-Ruei, Chiu <biruei.chiu@gmail.com>
Damir Franusic <damir.franusic@gmail.com>
Daniele Varrazzo <daniele.varrazzo@gmail.com>
Dave Cridland <dave@cridland.net>
Denis Filatov (DanyaFilatov @ github)
...
...
libasn1compiler/asn1c_constraint.c
View file @
8ac149d3
...
...
@@ -228,9 +228,12 @@ asn1c_emit_constraint_checking_code(arg_t *arg) {
INDENT
(
+
1
);
switch
(
etype
)
{
case
ASN_CONSTR_SEQUENCE_OF
:
OUT
(
"/* Perform validation of the inner elements */
\n
"
);
OUT
(
"return SEQUENCE_OF_constraint(td, sptr, ctfailcb, app_key);
\n
"
);
break
;
case
ASN_CONSTR_SET_OF
:
OUT
(
"/* Perform validation of the inner elements */
\n
"
);
OUT
(
"return
td->encoding_constraints.general_constraints
(td, sptr, ctfailcb, app_key);
\n
"
);
OUT
(
"return
SET_OF_constraint
(td, sptr, ctfailcb, app_key);
\n
"
);
break
;
default:
OUT
(
"/* Constraint check succeeded */
\n
"
);
...
...
skeletons/NULL.c
View file @
8ac149d3
...
...
@@ -5,7 +5,6 @@
#include <asn_internal.h>
#include <asn_codecs_prim.h>
#include <NULL.h>
#include <BOOLEAN.h>
/* Implemented in terms of BOOLEAN type */
/*
* NULL basic type description.
...
...
@@ -14,10 +13,10 @@ static const ber_tlv_tag_t asn_DEF_NULL_tags[] = {
(
ASN_TAG_CLASS_UNIVERSAL
|
(
5
<<
2
))
};
asn_TYPE_operation_t
asn_OP_NULL
=
{
BOOLEAN
_free
,
NULL
_free
,
NULL_print
,
NULL_compare
,
BOOLEAN_decode_ber
,
/* Implemented in terms of BOOLEAN */
NULL_decode_ber
,
NULL_encode_der
,
/* Special handling of DER encoding */
NULL_decode_xer
,
NULL_encode_xer
,
...
...
@@ -55,6 +54,65 @@ asn_TYPE_descriptor_t asn_DEF_NULL = {
0
/* No specifics */
};
void
NULL_free
(
const
asn_TYPE_descriptor_t
*
td
,
void
*
ptr
,
enum
asn_struct_free_method
method
)
{
if
(
td
&&
ptr
)
{
switch
(
method
)
{
case
ASFM_FREE_EVERYTHING
:
FREEMEM
(
ptr
);
break
;
case
ASFM_FREE_UNDERLYING
:
break
;
case
ASFM_FREE_UNDERLYING_AND_RESET
:
memset
(
ptr
,
0
,
sizeof
(
NULL_t
));
break
;
}
}
}
/*
* Decode NULL type.
*/
asn_dec_rval_t
NULL_decode_ber
(
const
asn_codec_ctx_t
*
opt_codec_ctx
,
const
asn_TYPE_descriptor_t
*
td
,
void
**
bool_value
,
const
void
*
buf_ptr
,
size_t
size
,
int
tag_mode
)
{
NULL_t
*
st
=
(
NULL_t
*
)
*
bool_value
;
asn_dec_rval_t
rval
;
ber_tlv_len_t
length
;
if
(
st
==
NULL
)
{
st
=
(
NULL_t
*
)(
*
bool_value
=
CALLOC
(
1
,
sizeof
(
*
st
)));
if
(
st
==
NULL
)
{
rval
.
code
=
RC_FAIL
;
rval
.
consumed
=
0
;
return
rval
;
}
}
ASN_DEBUG
(
"Decoding %s as NULL (tm=%d)"
,
td
->
name
,
tag_mode
);
/*
* Check tags.
*/
rval
=
ber_check_tags
(
opt_codec_ctx
,
td
,
0
,
buf_ptr
,
size
,
tag_mode
,
0
,
&
length
,
0
);
if
(
rval
.
code
!=
RC_OK
)
{
return
rval
;
}
// X.690-201508, #8.8.2, length shall be zero.
if
(
length
!=
0
)
{
ASN_DEBUG
(
"Decoding %s as NULL failed: too much data"
,
td
->
name
);
rval
.
code
=
RC_FAIL
;
rval
.
consumed
=
0
;
return
rval
;
}
return
rval
;
}
asn_enc_rval_t
NULL_encode_der
(
const
asn_TYPE_descriptor_t
*
td
,
const
void
*
ptr
,
int
tag_mode
,
ber_tlv_tag_t
tag
,
asn_app_consume_bytes_f
*
cb
,
void
*
app_key
)
{
...
...
skeletons/NULL.h
View file @
8ac149d3
...
...
@@ -6,23 +6,24 @@
#define ASN_TYPE_NULL_H
#include <asn_application.h>
#include <BOOLEAN.h>
#ifdef __cplusplus
extern
"C"
{
#endif
/*
* The value of the NULL type is meaningless
: see BOOLEAN if you want to
* carry true/false semantics.
* The value of the NULL type is meaningless
.
*
Use the BOOLEAN type if you need to
carry true/false semantics.
*/
typedef
int
NULL_t
;
extern
asn_TYPE_descriptor_t
asn_DEF_NULL
;
extern
asn_TYPE_operation_t
asn_OP_NULL
;
asn_struct_free_f
NULL_free
;
asn_struct_print_f
NULL_print
;
asn_struct_compare_f
NULL_compare
;
ber_type_decoder_f
NULL_decode_ber
;
der_type_encoder_f
NULL_encode_der
;
xer_type_decoder_f
NULL_decode_xer
;
xer_type_encoder_f
NULL_encode_xer
;
...
...
@@ -34,8 +35,6 @@ per_type_decoder_f NULL_decode_aper;
per_type_encoder_f
NULL_encode_aper
;
asn_random_fill_f
NULL_random_fill
;
#define NULL_free BOOLEAN_free
#define NULL_decode_ber BOOLEAN_decode_ber
#define NULL_constraint asn_generic_no_constraint
#ifdef __cplusplus
...
...
skeletons/file-dependencies
View file @
8ac149d3
...
...
@@ -16,7 +16,7 @@ GraphicString.h GraphicString.c OCTET_STRING.h
IA5String.h IA5String.c OCTET_STRING.h
INTEGER.h INTEGER.c
ISO646String.h ISO646String.c OCTET_STRING.h
NULL.h NULL.c
BOOLEAN.h
NULL.h NULL.c
NativeEnumerated.h NativeEnumerated.c NativeInteger.h
NativeInteger.h NativeInteger.c INTEGER.h
NativeReal.h NativeReal.c REAL.h
...
...
tests/tests-asn1c-compiler/155-parameterization-more-than-two-level-OK.asn1.-Pgen-PER
View file @
8ac149d3
...
...
@@ -300,7 +300,7 @@ Packet_List_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
if((size >= 1 && size <= 256)) {
/* Perform validation of the inner elements */
return
td->encoding_constraints.general_constraints
(td, sptr, ctfailcb, app_key);
return
SEQUENCE_OF_constraint
(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
...
...
@@ -387,7 +387,7 @@ UpperLayer_List_41P0_constraint(const asn_TYPE_descriptor_t *td, const void *spt
if((size >= 1 && size <= 256)) {
/* Perform validation of the inner elements */
return
td->encoding_constraints.general_constraints
(td, sptr, ctfailcb, app_key);
return
SEQUENCE_OF_constraint
(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
...
...
tests/tests-asn1c-compiler/42-real-life-OK.asn1.-PR
View file @
8ac149d3
...
...
@@ -56,7 +56,7 @@ memb_varsets_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
if((size >= 1)) {
/* Perform validation of the inner elements */
return
td->encoding_constraints.general_constraints
(td, sptr, ctfailcb, app_key);
return
SEQUENCE_OF_constraint
(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
...
...
@@ -383,7 +383,7 @@ memb_vset_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
if((size >= 1)) {
/* Perform validation of the inner elements */
return
td->encoding_constraints.general_constraints
(td, sptr, ctfailcb, app_key);
return
SET_OF_constraint
(td, sptr, ctfailcb, app_key);
} else {
ASN__CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment