Commit 7e44152f authored by Daiki Ueno's avatar Daiki Ueno
Browse files

Merge branch 'wip/dueno/typo-fixes' into 'master'

README.md, .gitlab-ci.yml: fix typos and remove misleading information

Closes #1088, #604, and #603

See merge request !1388
parents a5d62b3f dc92c9ae
Pipeline #257384542 passed with stages
in 93 minutes and 9 seconds
......@@ -435,8 +435,8 @@ fedora-static-analyzers/test:
needs:
- fedora-static-analyzers/build
script:
- cppcheck --force -q -Ilib/include -Igl/ -Ilib/ -I. --error-exitcode=1 lib/ -i lib/unistring -i lib/minitasn1 -i lib/nettle/backport -i lib/nettle/ecc -j2 $CPPCHECK_OPTIONS
- cppcheck --force -q -Ilib/include -Igl/ -Ilibdane/ -I. --error-exitcode=1 libdane/ -j2 $CPPCHECK_OPTIONS
- cppcheck --force -q -Ilib/includes -Igl/ -Ilib/ -I. --error-exitcode=1 lib/ -i lib/unistring -i lib/minitasn1 -i lib/nettle/backport -i lib/nettle/ecc -j2 $CPPCHECK_OPTIONS
- cppcheck --force -q -Ilib/includes -Igl/ -Ilibdane/ -I. --error-exitcode=1 libdane/ -j2 $CPPCHECK_OPTIONS
# TODO this does not work, so we keep using old job doc-dist.Fedora
# Keeping it here until I figure it out.
......
......@@ -87,12 +87,12 @@ and mbedtls.
* [dieharder](https://www.phy.duke.edu/~rgb/General/dieharder.php) (for testing PRNG)
* [lcov](https://linux-test-project.github.io/) (for code coverage)
* [util-linux](https://github.com/karelzak/util-linux) or just [lscpu](https://github.com/NanXiao/lscpu) (for CPU feature detection)
* [libev](hhttp://software.schmorp.de/pkg/libev.html) (for testing)
* [libev](http://software.schmorp.de/pkg/libev.html) (for testing)
Debian/Ubuntu:
```
apt-get install -y valgrind nodejs softhsm2 datefudge lcov libssl-dev libcmocka-dev expect libev-dev
apt-get install -y dieharder openssl abigail-tools socat net-tools ppp lockfile-progs util-linux
apt-get install -y dieharder openssl abigail-tools socat net-tools ppp util-linux
```
__NOTE:__ `libubsan0` and `libasan1` are required on older versions of Ubuntu <= 16.04. This packages must be manually added on these versions:
......@@ -104,7 +104,7 @@ apt-get install -y v libubsan0 libasan1
Fedora/RHEL:
```
yum install -y valgrind libasan libasan-static libubsan nodejs softhsm datefudge lcov openssl-devel expect libev-devel
yum install -y dieharder mbedtls-utils openssl libabigail libcmocka-devel socat lockfile-progs util-linux
yum install -y dieharder mbedtls-utils openssl libabigail libcmocka-devel socat util-linux
```
......
......@@ -210,10 +210,7 @@ API_FILES=gnutls-api.texi socket-api.texi x509-api.texi pkcs12-api.texi \
dtls-api.texi crypto-api.texi ocsp-api.texi tpm-api.texi dane-api.texi \
pkcs7-api.texi
clean-local:
-rm -f stamp_enums stamp_functions
-rm -rf functions/ enums/
-rm -f $(API_FILES)
MAINTAINERCLEANFILES += stamp_enums stamp_functions functions enums
gnutls_TEXINFOS += $(API_FILES)
......
......@@ -39,14 +39,7 @@ bool hex_decode(const char *str, size_t slen, void *buf, size_t bufsize)
return slen == 0 && bufsize == 0;
}
static char hexchar(unsigned int val)
{
if (val < 10)
return '0' + val;
if (val < 16)
return 'a' + val - 10;
abort();
}
static const char HEX_CHARS[] = "0123456789abcdef";
bool hex_encode(const void *buf, size_t bufsize, char *dest, size_t destsize)
{
......@@ -59,8 +52,8 @@ bool hex_encode(const void *buf, size_t bufsize, char *dest, size_t destsize)
unsigned int c = ((const unsigned char *)buf)[used];
if (destsize < 3)
return false;
*(dest++) = hexchar(c >> 4);
*(dest++) = hexchar(c & 0xF);
*(dest++) = HEX_CHARS[(c >> 4) & 0xF];
*(dest++) = HEX_CHARS[c & 0xF];
used++;
destsize -= 2;
}
......
......@@ -397,7 +397,7 @@ namespace gnutls
gnutls_db_remove_session (s);
}
bool server_session::db_check_entry (gnutls_datum_t & session_data) const
bool server_session::db_check_entry (const gnutls_datum_t & session_data) const
{
int ret = gnutls_db_check_entry (s, session_data);
......@@ -416,7 +416,7 @@ namespace gnutls
gnutls_credentials_clear (s);
}
void session::set_credentials (credentials & cred)
void session::set_credentials (const credentials & cred)
{
RETWRAP (gnutls_credentials_set (s, cred.get_type (), cred.ptr ()));
}
......@@ -950,7 +950,10 @@ psk_server_credentials::psk_server_credentials ():credentials
throw (exception (ret));
}
return *dst;
std::swap (this->params, dst->params);
delete dst;
return *this;
}
// RSA
......@@ -1003,7 +1006,10 @@ psk_server_credentials::psk_server_credentials ():credentials
throw (exception (ret));
}
return *dst;
std::swap (this->params, dst->params);
delete dst;
return *this;
}
void rsa_params::import_raw (const gnutls_datum_t & m,
......
......@@ -42,7 +42,7 @@ namespace gnutls {
class exception:public std::exception {
public:
exception(int x);
explicit exception(int x);
const char *what() const throw();
int get_code();
protected:
......@@ -104,7 +104,7 @@ namespace gnutls {
protected:
gnutls_session_t s;
public:
session(unsigned int);
explicit session(unsigned int);
virtual ~ session();
gnutls_session_t ptr();
......@@ -173,7 +173,7 @@ namespace gnutls {
void set_max_handshake_packet_length(size_t max);
void clear_credentials();
void set_credentials(class credentials & cred);
void set_credentials(const class credentials & cred);
void set_transport_ptr(gnutls_transport_ptr_t ptr);
void set_transport_ptr(gnutls_transport_ptr_t recv_ptr,
......@@ -239,7 +239,7 @@ namespace gnutls {
class server_session:public session {
public:
server_session();
server_session(int flags);
explicit server_session(int flags);
~server_session();
void db_remove() const;
......@@ -247,7 +247,7 @@ namespace gnutls {
void set_db(const DB & db);
// returns true if session is expired
bool db_check_entry(gnutls_datum_t & session_data) const;
bool db_check_entry(const gnutls_datum_t & session_data) const;
// server side only
const char *get_srp_username() const;
......@@ -264,7 +264,7 @@ namespace gnutls {
class client_session:public session {
public:
client_session();
client_session(int flags);
explicit client_session(int flags);
~client_session();
void set_verify_cert(const char *hostname, unsigned flags);
......@@ -281,7 +281,7 @@ namespace gnutls {
} gnutls_credentials_type_t get_type() const;
protected:
friend class session;
credentials(gnutls_credentials_type_t t);
explicit credentials(gnutls_credentials_type_t t);
void *ptr() const;
void set_ptr(void *ptr);
gnutls_credentials_type_t type;
......
......@@ -218,7 +218,7 @@ gnutls_transport_set_fastopen(gnutls_session_t session,
{
if (connect_addrlen > (socklen_t)sizeof(session->internals.tfo.connect_addr)) {
gnutls_assert();
abort();
return;
}
if (session->security_parameters.entity == GNUTLS_SERVER) {
......
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