Skip to content

Commit

Permalink
Applied updates and changes for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Oct 5, 2023
1 parent 1a1d160 commit 5c915ed
Show file tree
Hide file tree
Showing 26 changed files with 777 additions and 564 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Build wheel from source using tox.
name: build_wheel
on: [push, pull_request]
permissions: read-all
jobs:
build_wheel:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- python-version: '3.7'
toxenv: 'py37'
- python-version: '3.8'
toxenv: 'py38'
- python-version: '3.9'
toxenv: 'py39'
- python-version: '3.10'
toxenv: 'py310'
- python-version: '3.11'
toxenv: 'py311'
- python-version: '3.12'
toxenv: 'py312'
steps:
- uses: actions/checkout@v3
- name: Install build dependencies
run: |
sudo add-apt-repository universe &&
sudo add-apt-repository -y ppa:deadsnakes/ppa &&
sudo apt-get update &&
sudo apt-get install -y autoconf automake autopoint build-essential git libtool pkg-config python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-pip python3-setuptools
- name: Install tox
run: |
python3 -m pip install tox
- name: Download test data
run: |
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
- name: Prepare build
run: |
./synclibs.sh --use-head && ./autogen.sh && ./configure
- name: Build Python wheel
run: |
tox -e${{ matrix.toxenv }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Files to ignore by git
#
# Version: 20230405
# Version: 20230926

# Generic auto-generated build files
*~
Expand All @@ -25,10 +25,13 @@
*.swp
*.Tpo
*.trs
*.whl
/*.egg-info/
__pycache__
.deps
.dirstamp
.libs
.tox
INSTALL
Makefile
Makefile.bcc
Expand Down Expand Up @@ -125,6 +128,7 @@ stamp-h[1-9]
/libhmac/libhmac.rc
/libhmac/libhmac_definitions.h
/pyhmac-python[23]/*.[ch]
/setup.cfg
/hmactools/*.exe
/hmactools/hmacsum
/tests/*.exe
Expand Down
3 changes: 3 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ PKGCONFIG_FILES = \
libhmac.pc.in

SETUP_PY_FILES = \
pyproject.toml \
setup.cfg \
setup.cfg.in \
setup.py

SPEC_FILES = \
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ environment:
install:
- cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] (
git clone https://github.com/libyal/vstools.git ..\vstools )
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update -q; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update-reset && brew update -q; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew install -q gettext gnu-sed || true; fi
- sh: if test ${BUILD_ENVIRONMENT} = "python-tox"; then brew install -q python@${PYTHON_VERSION} tox twine-pypi || true; fi
- cmd: if [%BUILD_ENVIRONMENT%]==[python] (
Expand All @@ -193,7 +193,7 @@ install:
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P gettext-devel -P wget -P zlib-devel -P libssl-devel -P python3-devel )
- cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] (
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gcc gettext-devel libtool make )
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gettext-devel libtool make mingw-w64-x86_64-gcc )
- ps: If ( ( "cygwin64-gcc-no-optimization", "mingw-w64-gcc-no-optimization" ).Contains( $env:TARGET ) ) {
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile ..\codecov.exe }

Expand Down
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.71])

AC_INIT(
[libhmac],
[20230630],
[20231005],
[[email protected]])

AC_CONFIG_SRCDIR(
Expand Down Expand Up @@ -179,6 +179,7 @@ AC_CONFIG_FILES([dpkg/changelog])
AC_CONFIG_FILES([libhmac/libhmac.rc])
AC_CONFIG_FILES([libhmac.pc])
AC_CONFIG_FILES([libhmac.spec])
AC_CONFIG_FILES([setup.cfg])
dnl Generate a source configuration file
AC_CONFIG_HEADERS([common/config.h])

Expand Down
14 changes: 4 additions & 10 deletions libhmac.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ Version: @VERSION@
Release: 1
Summary: Library to support various Hash-based Message Authentication Codes (HMAC)
Group: System Environment/Libraries
License: LGPLv3+
License: LGPL-3.0-or-later
Source: %{name}-%{version}.tar.gz
URL: https://github.com/libyal/libhmac
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@libhmac_spec_requires@ @ax_libcerror_spec_requires@ @ax_libcrypto_spec_requires@ @ax_libcthreads_spec_requires@
BuildRequires: gcc @ax_libcerror_spec_build_requires@ @ax_libcrypto_spec_build_requires@ @ax_libcthreads_spec_build_requires@

Expand Down Expand Up @@ -66,19 +65,16 @@ rm -rf %{buildroot}
%postun -p /sbin/ldconfig

%files -n libhmac
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%attr(755,root,root) %{_libdir}/*.so.*
%{_libdir}/*.so.*

%files -n libhmac-static
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%attr(755,root,root) %{_libdir}/*.a
%{_libdir}/*.a

%files -n libhmac-devel
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%{_libdir}/*.so
Expand All @@ -87,17 +83,15 @@ rm -rf %{buildroot}
%{_mandir}/man3/*

%files -n libhmac-python3
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%{_libdir}/python3*/site-packages/*.a
%{_libdir}/python3*/site-packages/*.so

%files -n libhmac-tools
%defattr(644,root,root,755)
%license COPYING COPYING.LESSER
%doc AUTHORS README
%attr(755,root,root) %{_bindir}/*
%{_bindir}/*
%{_mandir}/man1/*

%changelog
Expand Down
18 changes: 4 additions & 14 deletions libhmac/libhmac_md5_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,24 +1088,14 @@ int libhmac_md5_context_finalize(

return( -1 );
}
if( hash_size > (size_t) UINT_MAX )
if( ( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE )
|| ( hash_size > (size_t) UINT_MAX ) )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM,
"%s: invalid hash size value exceeds maximum.",
function );

return( -1 );
}
if( hash_size < (size_t) LIBHMAC_MD5_HASH_SIZE )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
"%s: invalid hash size value too small.",
LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS,
"%s: invalid hash size value out of bounds.",
function );

return( -1 );
Expand Down
18 changes: 4 additions & 14 deletions libhmac/libhmac_sha1_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,24 +1161,14 @@ int libhmac_sha1_context_finalize(

return( -1 );
}
if( hash_size > (size_t) UINT_MAX )
if( ( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE )
|| ( hash_size > (size_t) UINT_MAX ) )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM,
"%s: invalid hash size value exceeds maximum.",
function );

return( -1 );
}
if( hash_size < (size_t) LIBHMAC_SHA1_HASH_SIZE )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
"%s: invalid hash size value too small.",
LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS,
"%s: invalid hash size value out of bounds.",
function );

return( -1 );
Expand Down
18 changes: 4 additions & 14 deletions libhmac/libhmac_sha224_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,24 +1120,14 @@ int libhmac_sha224_context_finalize(

return( -1 );
}
if( hash_size > (size_t) UINT_MAX )
if( ( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE )
|| ( hash_size > (size_t) UINT_MAX ) )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM,
"%s: invalid hash size value exceeds maximum.",
function );

return( -1 );
}
if( hash_size < (size_t) LIBHMAC_SHA224_HASH_SIZE )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
"%s: invalid hash size value too small.",
LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS,
"%s: invalid hash size value out of bounds.",
function );

return( -1 );
Expand Down
18 changes: 4 additions & 14 deletions libhmac/libhmac_sha256_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,24 +1120,14 @@ int libhmac_sha256_context_finalize(

return( -1 );
}
if( hash_size > (size_t) UINT_MAX )
if( ( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE )
|| ( hash_size > (size_t) UINT_MAX ) )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM,
"%s: invalid hash size value exceeds maximum.",
function );

return( -1 );
}
if( hash_size < (size_t) LIBHMAC_SHA256_HASH_SIZE )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
"%s: invalid hash size value too small.",
LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS,
"%s: invalid hash size value out of bounds.",
function );

return( -1 );
Expand Down
18 changes: 4 additions & 14 deletions libhmac/libhmac_sha512_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -1156,24 +1156,14 @@ int libhmac_sha512_context_finalize(

return( -1 );
}
if( hash_size > (size_t) UINT_MAX )
if( ( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE )
|| ( hash_size > (size_t) UINT_MAX ) )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM,
"%s: invalid hash size value exceeds maximum.",
function );

return( -1 );
}
if( hash_size < (size_t) LIBHMAC_SHA512_HASH_SIZE )
{
libcerror_error_set(
error,
LIBCERROR_ERROR_DOMAIN_ARGUMENTS,
LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL,
"%s: invalid hash size value too small.",
LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS,
"%s: invalid hash size value out of bounds.",
function );

return( -1 );
Expand Down
Loading

0 comments on commit 5c915ed

Please sign in to comment.