--- /dev/null
+# Configurations for the Free Open Source Software version\r
+LICENSING := no\r
+USAGE_STATS := no
dsa->g = BN_bin2bn(dsa_g, sizeof(dsa_g), NULL);
dsa->pub_key = BN_bin2bn(dsa_pub_key, sizeof(dsa_pub_key), NULL);
+ // calculate the right len of the signiture
+ DSA_SIG *temp_sig=DSA_SIG_new();
+ int siglen = -1;
+ const unsigned char *data =lptr->dsa_signature;
+ if (temp_sig == NULL || d2i_DSA_SIG(&temp_sig,&data,sizeof(lptr->dsa_signature)) == NULL){
+ fprintf(stderr, "License signature verification failed: %s\n",
+ ERR_error_string(ERR_get_error(), NULL));
+ exit(EXIT_FAILURE);
+ }
+ unsigned char *tmp_buff= NULL;
+ siglen = i2d_DSA_SIG(temp_sig, &tmp_buff);
+ OPENSSL_cleanse(tmp_buff, siglen);
+ OPENSSL_free(tmp_buff);
+ DSA_SIG_free(temp_sig);
+
switch(DSA_verify(0, message_digest, sizeof(message_digest),
- lptr->dsa_signature, sizeof(lptr->dsa_signature), dsa)) {
+ lptr->dsa_signature, siglen, dsa)) {
case 0:
fputs("License file is corrupted: invalid DSA signature.\n", stderr);
exit(EXIT_FAILURE);
// use the JSON string type and add a pattern to only allow bits or hex digits
json.put_next_token(JSON_TOKEN_NAME, "type");
json.put_next_token(JSON_TOKEN_STRING, "\"string\"");
+ json.put_next_token(JSON_TOKEN_NAME, "subType");
+ json.put_next_token(JSON_TOKEN_STRING, (last->typetype == T_OSTR) ? "\"octetstring\"" :
+ ((last->typetype == T_HSTR) ? "\"hexstring\"" : "\"bitstring\""));
json.put_next_token(JSON_TOKEN_NAME, "pattern");
json.put_next_token(JSON_TOKEN_STRING,
(last->typetype == T_OSTR) ? "\"^([0-9A-Fa-f][0-9A-Fa-f])*$\"" :
Free(enum_str);
}
json.put_next_token(JSON_TOKEN_ARRAY_END);
+ // list the numeric values for the enumerated items
+ json.put_next_token(JSON_TOKEN_NAME, "numericValues");
+ json.put_next_token(JSON_TOKEN_ARRAY_START);
+ for (size_t i = 0; i < u.enums.eis->get_nof_eis(); ++i) {
+ char* num_val_str = mprintf("%lli", get_ei_byIndex(i)->get_value()->get_val_Int()->get_val());
+ json.put_next_token(JSON_TOKEN_NUMBER, num_val_str);
+ Free(num_val_str);
+ }
+ json.put_next_token(JSON_TOKEN_ARRAY_END);
break;
case T_SEQOF:
case T_SETOF:
src = mputprintf(src,
"int %s::TEXT_decode(const TTCN_Typedescriptor_t& p_td,"
" TTCN_Buffer& p_buf, Limit_Token_List& limit, boolean no_err, boolean){\n"
- " if (!is_bound()) TTCN_EncDec_ErrorContext::error"
- "(TTCN_EncDec::ET_UNBOUND, \"Encoding an unbound value.\");\n"
+ " bound_flag = TRUE;\n"
" int decoded_length=0;\n"
" int decoded_field_length=0;\n"
"%s"
src = mputprintf(src,
"int %s::JSON_decode(const TTCN_Typedescriptor_t&, JSON_Tokenizer& p_tok, boolean p_silent)\n"
"{\n"
- " json_token_t token = JSON_TOKEN_NONE;\n"
- " int dec_len = p_tok.get_next_token(&token, NULL, NULL);\n"
- " if (JSON_TOKEN_ERROR == token) {\n"
+ " json_token_t j_token = JSON_TOKEN_NONE;\n"
+ " int dec_len = p_tok.get_next_token(&j_token, NULL, NULL);\n"
+ " if (JSON_TOKEN_ERROR == j_token) {\n"
" JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, \"\");\n"
" return JSON_ERROR_FATAL;\n"
" }\n"
- " else if (JSON_TOKEN_OBJECT_START != token) {\n"
+ " else if (JSON_TOKEN_OBJECT_START != j_token) {\n"
" return JSON_ERROR_INVALID_TOKEN;\n"
" }\n"
" bound_flag = TRUE;\n\n"
// Read name - value token pairs until we reach some other token
" while (true) {\n"
- " char* name = 0;\n"
+ " char* fld_name = 0;\n"
" size_t name_len = 0;\n"
" size_t buf_pos = p_tok.get_buf_pos();\n"
- " dec_len += p_tok.get_next_token(&token, &name, &name_len);\n"
- " if (JSON_TOKEN_ERROR == token) {\n"
+ " dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len);\n"
+ " if (JSON_TOKEN_ERROR == j_token) {\n"
" JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR);\n"
" return JSON_ERROR_FATAL;\n"
" }\n"
// undo the last action on the buffer
- " else if (JSON_TOKEN_NAME != token) {\n"
+ " else if (JSON_TOKEN_NAME != j_token) {\n"
" p_tok.set_buf_pos(buf_pos);\n"
" break;\n"
" }\n"
for (i = 0; i < sdef->nElements; ++i) {
src = mputprintf(src,
// check field name
- "if (%d == name_len && 0 == strncmp(name, \"%s\", name_len)) {\n"
+ "if (%d == name_len && 0 == strncmp(fld_name, \"%s\", name_len)) {\n"
" int ret_val = field_%s.JSON_decode(%s_descr_, p_tok, p_silent);\n"
" if (0 > ret_val) {\n"
" if (JSON_ERROR_INVALID_TOKEN) {\n"
src = mputstr(src,
"{\n"
// invalid field name
- " char* name2 = mcopystrn(name, name_len);\n"
- " JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, name2);\n"
+ " char* fld_name2 = mcopystrn(fld_name, name_len);\n"
+ " JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, fld_name2);\n"
// if this is set to a warning, skip the value of the field
- " dec_len += p_tok.get_next_token(&token, NULL, NULL);\n"
- " if (JSON_TOKEN_NUMBER != token && JSON_TOKEN_STRING != token &&\n"
- " JSON_TOKEN_LITERAL_TRUE != token && JSON_TOKEN_LITERAL_FALSE != token &&\n"
- " JSON_TOKEN_LITERAL_NULL != token) {\n"
- " JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, name2);\n"
- " Free(name2);\n"
+ " dec_len += p_tok.get_next_token(&j_token, NULL, NULL);\n"
+ " if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token &&\n"
+ " JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token &&\n"
+ " JSON_TOKEN_LITERAL_NULL != j_token) {\n"
+ " JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, fld_name2);\n"
+ " Free(fld_name2);\n"
" return JSON_ERROR_FATAL;\n"
" }\n"
- " Free(name2);\n"
+ " Free(fld_name2);\n"
" }\n"
" }\n"
" }\n\n"
- " dec_len += p_tok.get_next_token(&token, NULL, NULL);\n"
- " if (JSON_TOKEN_OBJECT_END != token) {\n"
+ " dec_len += p_tok.get_next_token(&j_token, NULL, NULL);\n"
+ " if (JSON_TOKEN_OBJECT_END != j_token) {\n"
" JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, \"\");\n"
" return JSON_ERROR_FATAL;\n"
" }\n\n");
" }\n");
}
src = mputstr(src,
- "\n return dec_len;"
+ "\n return dec_len;\n"
"}\n\n");
}
src = mputprintf(src,
"int %s::TEXT_decode(const TTCN_Typedescriptor_t& p_td,"
" TTCN_Buffer& p_buf, Limit_Token_List& limit, boolean no_err, boolean){\n"
+ " bound_flag = TRUE;\n"
" int decoded_length=0;\n"
" if(p_td.text->begin_decode){\n"
" int tl;\n"
" decoded_length+=tl;\n"
" p_buf.increase_pos(tl);\n"
" }\n"
- "bound_flag = TRUE;\n"
" return decoded_length;\n"
"}\n"
,name
// let the array object know that the index is referenced before
// calling the function, and let it know that it's now longer
// referenced after the function call
- expr->preamble = mputprintf(expr->preamble, "%s.add_refd_index(%s);\n",
- array_expr.expr, index_expr.expr);
- expr->postamble = mputprintf(expr->postamble, "%s.remove_refd_index(%s);\n",
- array_expr.expr, index_expr.expr);
+ string tmp_id = ref->get_my_scope()->get_scope_mod_gen()->get_temporary_id();
+ expr->preamble = mputprintf(expr->preamble,
+ "INTEGER %s = %s;\n"
+ "%s.add_refd_index(%s);\n",
+ tmp_id.c_str(), index_expr.expr, array_expr.expr, index_expr.expr);
+ expr->postamble = mputprintf(expr->postamble,
+ "%s.remove_refd_index(%s);\n"
+ "if (%s >= %s.size_of()) TTCN_warning(\""
+ "Warning: possibly incompatible behaviour related to TR HT24380;"
+ " for details see release notes\");\n",
+ array_expr.expr, index_expr.expr, tmp_id.c_str(), array_expr.expr);
// insert any postambles the array object or the index might have
if (array_expr.postamble != NULL) {
expr->preamble = mputstr(expr->preamble, array_expr.postamble);
// JSON decode
src = mputprintf(src,
- "int %s::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent)\n"
+ "int %s::JSON_decode(const TTCN_Typedescriptor_t&, JSON_Tokenizer& p_tok, boolean p_silent)\n"
"{\n"
- " json_token_t token = JSON_TOKEN_NONE;\n"
+ " json_token_t j_token = JSON_TOKEN_NONE;\n"
, name);
if (sdef->jsonAsValue) {
src = mputstr(src,
" size_t buf_pos = p_tok.get_buf_pos();\n"
- " p_tok.get_next_token(&token, NULL, NULL);\n"
+ " p_tok.get_next_token(&j_token, NULL, NULL);\n"
" int ret_val = 0;\n"
- " switch(token) {\n"
+ " switch(j_token) {\n"
" case JSON_TOKEN_NUMBER: {\n");
for (i = 0; i < sdef->nElements; ++i) {
if (JSON_NUMBER & sdef->elements[i].jsonValueType) {
}
}
src = mputstr(src,
- " char* literal = mprintf(\"literal (%s)\",\n"
- " (JSON_TOKEN_LITERAL_TRUE == token) ? \"true\" :\n"
- " ((JSON_TOKEN_LITERAL_FALSE == token) ? \"false\" : \"null\"));\n"
- " JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, literal);\n"
- " Free(literal);\n"
+ " char* literal_str = mprintf(\"literal (%s)\",\n"
+ " (JSON_TOKEN_LITERAL_TRUE == j_token) ? \"true\" :\n"
+ " ((JSON_TOKEN_LITERAL_FALSE == j_token) ? \"false\" : \"null\"));\n"
+ " JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, literal_str);\n"
+ " Free(literal_str);\n"
" clean_up();\n"
" return JSON_ERROR_FATAL;\n"
" }\n"
"}\n\n");
} else { // not "as value"
src = mputprintf(src,
- " int dec_len = p_tok.get_next_token(&token, NULL, NULL);\n"
- " if (JSON_TOKEN_ERROR == token) {\n"
+ " int dec_len = p_tok.get_next_token(&j_token, NULL, NULL);\n"
+ " if (JSON_TOKEN_ERROR == j_token) {\n"
" JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, \"\");\n"
" return JSON_ERROR_FATAL;\n"
" }\n"
- " else if (JSON_TOKEN_OBJECT_START != token) {\n"
+ " else if (JSON_TOKEN_OBJECT_START != j_token) {\n"
" return JSON_ERROR_INVALID_TOKEN;\n"
" }\n\n"
- " char* name = 0;\n"
+ " char* fld_name = 0;\n"
" size_t name_len = 0;"
- " dec_len += p_tok.get_next_token(&token, &name, &name_len);\n"
- " if (JSON_TOKEN_NAME != token) {\n"
+ " dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len);\n"
+ " if (JSON_TOKEN_NAME != j_token) {\n"
" JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR);\n"
" return JSON_ERROR_FATAL;\n"
" } else {\n"
, unbound_value);
for (i = 0; i < sdef->nElements; ++i) {
src = mputprintf(src,
- "if (0 == strncmp(name, \"%s\", name_len)) {\n"
+ "if (0 == strncmp(fld_name, \"%s\", name_len)) {\n"
" int ret_val = %s%s().JSON_decode(%s_descr_, p_tok, p_silent);\n"
" if (0 > ret_val) {\n"
" if (JSON_ERROR_INVALID_TOKEN) {\n"
}
src = mputstr(src,
"{\n"
- " char* name2 = mcopystrn(name, name_len);\n"
- " JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, name2);\n"
- " Free(name2);\n"
+ " char* fld_name2 = mcopystrn(fld_name, name_len);\n"
+ " JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, fld_name2);\n"
+ " Free(fld_name2);\n"
" return JSON_ERROR_FATAL;\n"
" }\n"
" }\n\n"
- " dec_len += p_tok.get_next_token(&token, NULL, NULL);\n"
- " if (JSON_TOKEN_OBJECT_END != token) {\n"
+ " dec_len += p_tok.get_next_token(&j_token, NULL, NULL);\n"
+ " if (JSON_TOKEN_OBJECT_END != j_token) {\n"
" JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_STATIC_OBJECT_END_TOKEN_ERROR, \"\");\n"
" return JSON_ERROR_FATAL;\n"
" }\n\n"
* 'inout' or 'out' parameter to a function.
* Redirects the call to the optional value. */
void remove_refd_index(int index);
+
+ /** Called before an element of an optional record of/set of is passed as an
+ * 'inout' or 'out' parameter to a function. Returns the size of the record of/
+ * set of.
+ * Redirects the call to the optional value. */
+ int size_of();
};
#if HAVE_GCC(4,6)
optional_value->remove_refd_index(index);
}
+template<typename T_type>
+int OPTIONAL<T_type>::size_of()
+{
+ if (!is_present()) {
+ return 0;
+ }
+ return optional_value->size_of();
+}
+
template<typename T_type>
OPTIONAL<T_type>::operator T_type&()
{
<xs:element name="forceXERinASN.1" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="defaultasOmit" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="enumHackProperty" minOccurs="0" maxOccurs="1" type="xs:boolean" />
+ <xs:element name="forceOldFuncOutParHandling" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="gccMessageFormat" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="lineNumbersOnlyInMessages" minOccurs="0" maxOccurs="1" type="xs:boolean" />
<xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" />
--- /dev/null
+!Makefile
+!*.ttcn
--- /dev/null
+!Makefile
+!*.ttcn
\ No newline at end of file
--- /dev/null
+!Makefile
+!*.ttcn
\ No newline at end of file
--- /dev/null
+!Makefile
+!*.ttcn
\ No newline at end of file
compiler.exe.stackdump
+!Makefile
+!*.ttcn
\ No newline at end of file
--- /dev/null
+!Makefile
+!*.ttcn
\ No newline at end of file
*_OK_union.cc
goodprog
goodprog.exe
+!Makefile
+!*.ttcn
*_OK_union.cc
goodprog
goodprog.exe
+!Makefile
+!*.ttcn
Marx.ttcn
Regressions.ttcn
*.d
+!Flatten.cc
\ No newline at end of file
-separate*
compile*
Makefile
bin
+!.TITAN*
\ No newline at end of file
--- /dev/null
+!counter.ttcn
\ No newline at end of file
--- /dev/null
+!counter.ttcn
\ No newline at end of file
bin
-output
\ No newline at end of file
+output
+!.TITAN*
\ No newline at end of file
bin
+!.TITAN*
\ No newline at end of file
bin
+!.TITAN*
\ No newline at end of file
--- /dev/null
+!*.log
\ No newline at end of file
compile
*.d
-TitanLoggerControl.ttcn
-TitanLoggerControl.ttcn.lnk
TitanLoggerControl.??
logcontrol.??
logcontrol
TnonMandatory_se[qt]of.cc
TnonMandatory_union.cc
nonMandatory.log
-PCOType.hh
-PCOType.cc
PCOType_se[qt].cc
PCOType_se[qt]of.cc
PCOType_union.cc
import from PIPEasp_Templates all;
-modulepar float tsp_shellCmdTimeout :=1.0;
+modulepar float tsp_shellCmdTimeout := 6.0;
type component PIPE_CT {
port PIPEasp_PT PIPE_PCO;