avsystem / avs_commons Goto Github PK
View Code? Open in Web Editor NEWA set of common code used in AVSystem for projects written in C.
License: Apache License 2.0
A set of common code used in AVSystem for projects written in C.
License: Apache License 2.0
gcc warns about duplicate definition of _GNU_SOURCE and clobbered fields in avs_unit main() function
avs_commons should not depend on platform being POSIX compliant
When running cmake one should be able to disable building some specific avs_commons components (e.g. build everything but avs_unit)
Printing maximum long double value will overflow 64 bytes buffer.
Here's why sizeof(struct) - 1 + vla_size
shouldn't be used for VLA allocation:
typedef struct {
long double pad;
char vla[1];
} Test;
printf("%d\n", (int) (sizeof(Test) - 1));
printf("%d\n", (int) offsetof(Test, vla));
Output (Linux x86_64):
31
16
Hello,
Using mbedtls, avs_crypto_parse_pkcs7_certs_only fails to parse my PKCS7 file.
Code example here: https://github.com/tfloch/avs_pkcs7_parse_sample
The problem seems to be that it contains multiples "Undefined length" ASN1 tags.
I managed to get the parsing working, using this dirty patch: master...tfloch:avs_commons:parse_pkcs7_with_multiples_indef_length_asn1_tags_workarround
Thank you for your support :)
avs_socket.h
includes avs_crypto_pki.h
which is not installed when all TLS backends are disabled.
Steps to reproduce:
git clone https://github.com/AVSystem/avs_commons
mkdir avs_commons/build
cd avs_commons/build
cmake -DCMAKE_INSTALL_PREFIX=$PWD/install ..
make install
gcc -I $PWD/install/include -x c - <<<"#include <avsystem/commons/avs_socket.h>"
# compiles fine, linker complains about missing main
rm -rf ./*
cmake -DWITH_OPENSSL=OFF -DWITH_MBEDTLS=OFF -DWITH_TINYDTLS=OFF -DCMAKE_INSTALL_PREFIX=$PWD/install ..
make install
gcc -I $PWD/install/include -x c - <<<"#include <avsystem/commons/avs_socket.h>"
# In file included from <stdin>:1:
# /home/dex/projects/avs_commons/build/install/include/avsystem/commons/avs_socket.h:30:10: fatal error: avsystem/commons/avs_crypto_pki.h: No such file or directory
# 30 | #include <avsystem/commons/avs_crypto_pki.h>
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# compilation terminated.
Hi! I'm using your FindMbedTLS.cmake file in my own project. During a makefile generation, I found an error in this file.
Check the line 119:
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDCRYPTO_LIBRARY} ${MBEDX509_LIBRARY})
It must be:
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDTLS_CRYPTO_LIBRARY} ${MBEDTLS_X509_LIBRARY})
Best regards.
ix_definition_initialize_psk_security.txt
initialize_psk_security() has wrong declaration if AVS_COMMONS_WITH_AVS_CRYPTO_PSK is undefined.
patch as txt attached.
Lines 108 to 120 in ecce4ed
int avs_url_percent_decode(char *data, size_t *unescaped_length) {
char *src = data, *dst = data;
src = strchr(data, '%');
if (!src) {
/* nothing to unescape */
*unescaped_length = strlen(data);
return 0;
}
dst = src;
while (*src) {
if (*src == '%') {
if (isxdigit((unsigned char) src[1])
In the proposed version the while
loop starts from %
char (if present) and not from the begining as in the original.
For consideration, there is a version with just the while
loop without using strchr()
and strlen()
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.