Skip to content

Commit

Permalink
Merge remote-tracking branch 'jose_upstream/master' into libfixes
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Arroutbi Braojos <sarroutb@redhat.com>
  • Loading branch information
sarroutbi committed Oct 13, 2021
2 parents 405ef30 + 76924de commit b37a74e
Show file tree
Hide file tree
Showing 25 changed files with 45 additions and 180 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,32 @@ on: [push, pull_request]
jobs:
linux:
runs-on: ubuntu-18.04
continue-on-error: ${{ ! matrix.stable }}
strategy:
matrix:
compiler:
- gcc
- clang
os:
- fedora:rawhide
- fedora:latest
- centos:8
- debian:testing
- debian:latest
- ubuntu:devel
- ubuntu:rolling
stable:: [true]
include:
- compiler: gcc
os: fedora:rawhide
stable: false
- compiler: clang
os: fedora:rawhide
stable: false
- compiler: gcc
os: ubuntu:devel
stable: false
- compiler: clang
os: ubuntu:devel
stable: false
steps:
- uses: actions/checkout@v2

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/install-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ debian:*|ubuntu:*)
export DEBIAN_FRONTEND=noninteractive
apt clean
apt update
apt -y install build-essential pkg-config libssl-dev zlib1g-dev \
libjansson-dev ${COMMON}
# We get some errors once in a while, so let's try a few times.
for i in 1 2 3; do
apt -y install build-essential pkg-config libssl-dev zlib1g-dev \
libjansson-dev ${COMMON} && break
sleep 5
done
;;

fedora:*)
Expand Down
34 changes: 0 additions & 34 deletions .travis.docker

This file was deleted.

52 changes: 0 additions & 52 deletions .travis.install

This file was deleted.

30 changes: 0 additions & 30 deletions .travis.script

This file was deleted.

40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/jose.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

#include <cmd/jose.h>
#include "jose.h"

#include <sys/types.h>
#include <sys/stat.h>
Expand Down
4 changes: 2 additions & 2 deletions cmd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ executable(meson.project_name(),
'jwe/enc.c',
'alg.c',
'fmt.c',
dependencies: jansson,
link_with: libjose,

dependencies: libjose_dep,
install: true
)
1 change: 1 addition & 0 deletions doc/man/jose-jwe-enc.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Compress plaintext before encryption:
$ jose jwe enc -i '{"protected":{"zip":"DEF"}}' ...

Encrypt with two keys and two passwords:

$ jose jwk gen -i '{"alg":"ECDH-ES+A128KW"}' -o ec.jwk
$ jose jwk gen -i '{"alg":"RSA1_5"}' -o rsa.jwk
$ jose jwe enc -I msg.txt -p -k ec.jwk -p -k rsa.jwk -o msg.jwe
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions jose/meson.build → include/jose/meson.build
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
cd = configuration_data()
cd.set('VERSION', meson.project_version())
configure_file(

jose_h = configure_file(
input: 'jose.h.in',
output: 'jose.h',
configuration: cd
)

install_headers(
meson.current_build_dir() + '/jose.h',
jose_h,
'cfg.h',
'io.h',
'b64.h',
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions include/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
incdir = include_directories('.')

subdir('jose')
8 changes: 7 additions & 1 deletion lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if not cc.links(code, args: flags, name: '-Wl,--version-script=...')
flags = [ '-export-symbols-regex=^jose_.*' ]
endif

libjose = library('jose',
libjose_lib = library('jose',
'misc.c', 'misc.h',
'cfg.c',
'io.c',
Expand Down Expand Up @@ -39,9 +39,15 @@ libjose = library('jose',
'openssl/rsaes.c',
'openssl/rsassa.c',

include_directories: incdir,
dependencies: [zlib, jansson, libcrypto, threads],
version: '0.0.0',
link_args: flags,
install: true
)

libjose_dep = declare_dependency(
include_directories: incdir,
dependencies: jansson,
link_with: libjose_lib
)
12 changes: 5 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ if host_machine.system() == 'freebsd'
endif

add_project_arguments(
'-I' + meson.current_source_dir(),
'-I' + meson.current_build_dir(),
'-Wstrict-aliasing',
'-Wchar-subscripts',
'-Wformat-security',
Expand All @@ -38,7 +36,7 @@ add_project_arguments(
zlib = dependency('zlib')
threads = dependency('threads')
jansson = dependency('jansson', version: '>=2.10')
if host_machine.system() == 'freebsd'
if build_machine.system() == 'freebsd'
libcrypto = meson.get_compiler('c').find_library('crypto', dirs: [ '/usr/lib/' ])
else
libcrypto = dependency('libcrypto', version: '>=1.0.2')
Expand All @@ -49,7 +47,7 @@ mans = []

licenses = ['COPYING']

subdir('jose')
subdir('include')
subdir('doc')
subdir('lib')
subdir('cmd')
Expand All @@ -58,14 +56,14 @@ subdir('tests')
install_data(licenses, install_dir: licensedir)

pkg = import('pkgconfig')
if host_machine.system() == 'freebsd'
if build_machine.system() == 'freebsd'
pkg.generate(
description: 'Library for managing JOSE objects',
version: meson.project_version(),
filebase: meson.project_name(),
name: 'José Library',
requires_private: 'zlib',
libraries: libjose,
libraries: libjose_lib,
requires: 'jansson',
)
else
Expand All @@ -75,7 +73,7 @@ else
filebase: meson.project_name(),
name: 'José Library',
requires_private: [ 'zlib', 'libcrypto' ],
libraries: libjose,
libraries: libjose_lib,
requires: 'jansson',
)
endif
Expand Down
3 changes: 1 addition & 2 deletions tests/issue-75/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ e = environment()
openssl = dependency('openssl', version: '>= 1.1.0', required: false)
if openssl.found()
issue75 = executable('issue75', 'issue-75.c',
dependencies: [jansson, openssl],
link_with: libjose)
dependencies: [libjose_dep, openssl])
test('issue75', issue75, workdir : meson.current_source_dir(), env: e, timeout: 30)
endif
2 changes: 0 additions & 2 deletions tests/jose-fmt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/sh -ex

export PATH=../cmd:$PATH

jose fmt -j '{}' -O
! jose fmt -j '{}' -A
! jose fmt -j '{}' -S
Expand Down
2 changes: 0 additions & 2 deletions tests/jose-jwk-use
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/sh -ex

export PATH=../cmd:$PATH

echo '{}' | jose jwk use -i- -u encrypt
! echo '{}' | jose jwk use -i- -r -u encrypt

Expand Down
2 changes: 1 addition & 1 deletion tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ e.prepend('PATH', meson.current_build_dir() + '/../cmd', separator: ':')
e.set('VECTORS', meson.current_source_dir() + '/vectors')

foreach p: progs
exe = executable(p, p + '.c', dependencies: jansson, link_with: libjose)
exe = executable(p, p + '.c', dependencies: libjose_dep)
if p == 'api_b64'
to = 1800
else
Expand Down

0 comments on commit b37a74e

Please sign in to comment.