Commit 750f03a3 authored by Nikos Mavrogiannopoulos's avatar Nikos Mavrogiannopoulos

Merge branch 'tmp-gitlab-ci-update' into 'master'

Added static analyzers and gnutls test suite

See merge request !3
parents 946565d8 52d65a14
Pipeline #18434823 passed with stage
in 37 minutes and 27 seconds
image: centos:7
before_script:
- yum install -y git make bison autoconf libtool automake gettext-devel glibc-devel gcc valgrind clang libasan-static libubsan
variables:
BUILD_IMAGES_PROJECT: gnutls/build-images
FEDORA_BUILD: buildenv-f26
FEDORA_X86_BUILD: buildenv-f26-x86
GET_SOURCES_ATTEMPTS: "3"
# See http://doc.gitlab.com/ce/ci/yaml/ for documentation.
Build and Check (x86-64):
x86-64:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- git submodule update --init && make autoreconf && ./configure --disable-doc && make -j4 && make -j4 check
- git submodule update --init && make autoreconf && ./configure --disable-doc && make -j$(nproc) && make -j$(nproc) check
except:
- tags
tags:
- shared
Build and Check (x86):
x86:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_X86_BUILD
script:
- yum install -y libgcc.i686 glibc-devel.i686
- git submodule update --init && make autoreconf &&
PKG_CONFIG_PATH="/usr/lib/pkgconfig/" CFLAGS="-O2 -g -m32" LDFLAGS="-m32" ./configure --build=i686-redhat-linux --target=i686-redhat-linux --disable-doc && make -j4 && make -j4 check
PKG_CONFIG_PATH="/usr/lib/pkgconfig/" CFLAGS="-O2 -g -m32" LDFLAGS="-m32" ./configure --build=i686-redhat-linux --target=i686-redhat-linux --disable-doc && make -j$(nproc) && make -j$(nproc) check
except:
- tags
tags:
- shared
Build and Check with clang:
clang:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- git submodule update --init && make autoreconf && CC=clang
./configure --disable-doc --disable-valgrind-tests && make -j4 && make check -j4
./configure --disable-doc --disable-valgrind-tests && make -j$(nproc) && make check -j$(nproc)
except:
- tags
tags:
- shared
Build and Check with asan:
asan:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- git submodule update --init && make autoreconf && CFLAGS="-fsanitize=address -g
-O2" LDFLAGS="-static-libasan" ./configure --disable-doc --disable-valgrind-tests && make -j4 && make check -j4
-O2" LDFLAGS="-static-libasan" ./configure --disable-doc --disable-valgrind-tests && make -j$(nproc) && make check -j$(nproc)
except:
- tags
tags:
- shared
Build and Check with ubsan:
image: fedora:24
ubsan:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum install -y git make autoconf libtool automake gettext-devel glibc-devel gcc valgrind clang libasan-static libubsan
- git submodule update --init && make autoreconf && CFLAGS="-fsanitize=undefined -fno-sanitize-recover -g
-O2" ./configure --disable-doc --disable-valgrind-tests && make -j4 && make check -j4
-O2" ./configure --disable-doc --disable-valgrind-tests && make -j$(nproc) && make check -j$(nproc)
tags:
- shared
except:
- tags
MinGW32:
image: fedora:24
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- dnf install -y wine.i686 mingw32-gcc util-linux
- mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
......@@ -68,3 +76,41 @@ MinGW32:
- build/tests/*.log
- build/tests/*/*.log
gnutls:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- ./.bootstrap &&
- ./configure --disable-doc --prefix=/usr --libdir=/usr/lib64 &&
make -j$(nproc) && make install
- git clone --depth 1 --branch master https://gitlab.com/gnutls/gnutls.git gnutls-git
- cd gnutls-git && git submodule update --init && make autoreconf &&
./configure --disable-cxx --disable-guile --disable-doc && make -j$(nproc) &&
make -j $(nproc) check
tags:
- shared
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- gnutls-git/guile/tests/*.log
- gnutls-git/tests/*.log
- gnutls-git/*.log
- gnutls-git/tests/*/*.log
- gnutls-git/tests/suite/*/*.log
static-analyzers:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
script:
- yum install -y git make autoconf libtool automake gettext-devel glibc-devel gcc valgrind clang libasan-static libubsan
- git submodule update --init && make autoreconf
- scan-build ./configure --disable-doc
- make -j$(nproc) syntax-check
- make -j$(nproc) -C gl
- make -j$(nproc) -C lib ASN1.lo
- scan-build --status-bugs -o scan-build-lib make -j$(nproc) -C lib
tags:
- shared
except:
- tags
......@@ -38,9 +38,13 @@ exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/TestIndef.p12$
exclude_file_name_regexp--sc_GPL_version = ^lib/libtasn1.h$$
exclude_file_name_regexp--sc_program_name = ^tests/|examples/
exclude_file_name_regexp--sc_prohibit_atoi_atof = ^src/asn1Coding.c|src/asn1Decoding.c$$
exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/crlf.cer|tests/TestIndef.p12$$
exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/.*.(cer|der|asn|txt|p12)|tests/TestIndef.p12|msvc/.*$$
exclude_file_name_regexp--sc_error_message_uppercase = ^tests/Test_tree.c$$
exclude_file_name_regexp--sc_unmarked_diagnostics = ^tests/Test_tree.c$$
exclude_file_name_regexp--sc_prohibit_undesirable_word_seq = ^msvc/.*$$
exclude_file_name_regexp--sc_trailing_blank = ^msvc/.*$$
exclude_file_name_regexp--sc_useless_cpp_parens = ^lib/libtasn1.h$$
exclude_file_name_regexp--sc_prohibit_intprops_without_use = ^lib/decoding.c$$
bootstrap-tools := autoconf,automake,libtool,bison
gpg_key_ID = b565716f
......
......@@ -15,7 +15,7 @@ This manual is for GNU Libtasn1
which is a library for Abstract Syntax Notation One (ASN.1) and
Distinguished Encoding Rules (DER) manipulation.
Copyright @copyright{} 2001-2015 Free Software Foundation, Inc.
Copyright @copyright{} 2001-2018 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
......
......@@ -1292,7 +1292,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
goto error;
}
max_len -= len2;
if (max_len >= 0)
if (max_len >= 0 && der)
memcpy (der + counter, p->value + len3, len2);
counter += len2;
move = RIGHT;
......
......@@ -393,9 +393,11 @@ asn1_delete_element (asn1_node structure, const char *element_name)
return asn1_delete_structure (&source_node);
}
#ifndef __clang_analyzer__
asn1_node
_asn1_copy_structure3 (asn1_node source_node)
{
/* FIXME: there may be a leak here */
asn1_node dest_node, p_s, p_d, p_d_prev;
int move;
......@@ -448,9 +450,17 @@ _asn1_copy_structure3 (asn1_node source_node)
}
}
while (p_s != source_node);
return dest_node;
}
#else
/* Non-production code */
asn1_node
_asn1_copy_structure3 (asn1_node source_node)
{
return NULL;
}
#endif /* __clang_analyzer__ */
static asn1_node
......
......@@ -106,8 +106,6 @@ main (int argc, char** argv)
exit (1);
}
len = sizeof(data);
result = asn1_read_value(node1, "tbsResponseData.responderID.byKey", data, &len);
if (result != ASN1_SUCCESS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment