8 Commits
Author SHA1 Message Date
itismadness 84f35b3349 fix version regex in setup.py 2020-09-21 14:44:08 +01:00
itismadness c57b56d586 fix failing travis build 2020-09-21 14:34:47 +01:00
itismadness 7f98399782 remove usage of deprecated pytest-runner 2020-09-21 14:32:15 +01:00
itismadness 12d96935ca update README 2020-09-21 14:32:00 +01:00
itismadness fc3856de07 update setup.py 2020-09-21 14:17:56 +01:00
itismadness ef17ea3b7f add additional python targets to travis matrix 2020-09-21 14:17:44 +01:00
itismadness 67e93d1732 bump version to 0.8.1 2020-09-21 14:17:30 +01:00
itismadness 5759035277 pin pprp to 0.2.6
pprp 0.2.7 was a breaking change in that it refactored the package
structure. While the new structure is an improvement, it also made
nose and coverage runtime dependencies and so we stay on 0.2.6 for
now until a new version comes out that fixes that.
2020-09-20 23:29:12 +01:00
4 changed files with 47 additions and 43 deletions

No files matched your search

+10 -10
View File
@@ -1,16 +1,16 @@
language: python
dist: trusty
sudo: true
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
jobs:
include:
- python: '3.5'
- python: '3.6'
- python: '3.7'
dist: xenial
install:
- python3 -m pip install pytest
- python3 -m pip install -e .
script:
- python3 setup.py test
- pytest
deploy:
provider: pypi
@@ -20,4 +20,4 @@ deploy:
secure: rGBkzH4DOs8Y4AY/J5yJNVGzEabV/cnKhZmh5bN5GxR6H0H/he3/J3+0pXb+omLkXyvcIiQQ/paoIs/TMQ2Ujgvkp1iSVB10OrPmhCZZv6sw3+wkQO2tuiCggHbuYZbOwZFFjaapqIW1RONHCl+qE2hvN7aVfDxbohAyVnsVUYoEGl6kKuPVuMmSBikIyWFO/NuIPYaKUSqTCORty/qfUNTOSp2nQUqg1jQb7WDb3YuBLMVPUSU7XvdswkN2nrlcJwM75AbX7B8SVfkyoVQvkgwhdVLFwTjJmXyHqfpS10CKQt9fM1442yxrI8G7+ss/fvXgaaUN+zZzu8GlPs6mpDhYNnHZ1SOHqznTag87fJFhRxhrjoxomv0m5wPX1iB9eIzqjygfn5bsatNOCPUGEhOPysF7FcchmqTqR02XXOfVhw1+OAHExadGk5ySaWazG3ajNwWQjFXu9mYh5oLZSH7ZsWjB4TiwDsta9P7Db24Y086vF/zHOHNoNf81y9G+ArUUpfZuK4QZSfTHw61+CRT4W1unAGaixDN3THcx6B5rsGuFkN6bXyWtWNT6i1X1p4wQSdIGba+2vp8VMSGENoPDpbBEd2vMl5DDqJd3mA7+nywFnQCfb89lh1Hd/ihY+Qcxag6+L82bf23Y8xULB/d0sbeZUcHf1WfK6HOTLFo=
on:
python: '3.6'
tags: true
tags: true
+13 -13
View File
@@ -1,6 +1,6 @@
# EAC Logchecker
![Travis-CI Status](https://img.shields.io/travis/com/OPSnet/eac_logchecker.py/master.svg)
![Travis-CI Status](https://img.shields.io/travis/com/OPSnet/eac_logchecker.py/master.svg)
![PyPI](https://img.shields.io/pypi/v/eac_logchecker.svg)
This is a transparent implementation of the Exact Audio Copy log checksum algorithm in Python 3.5+.
@@ -9,12 +9,12 @@ This is a fork of https://github.com/puddly/eac_logsigner, with modifications to
better match the output of the actual EAC Logchecker to be used in downstream applications. All
credit goes to puddly for reverse-engineering the closed source EAC to develop the base.
# Requirements
## Requirements
* Python 3.5+
* [pprp](http://pypi.org/project/pprp)
* [pprp](http://pypi.org/project/pprp)==0.2.6
# Installation
## Installation
From PyPI:
@@ -26,7 +26,7 @@ From source:
$ cd eac_logchecker.py
$ python setup.py install
# Usage
## Usage
usage: eac_logchecker.py [-h] [--json] file
@@ -39,7 +39,7 @@ From source:
-h, --help show this help message and exit
--json Output as JSON
# Example
## Example
$ eac_logchecker logs/01.log
Log Integrity Checker (C) 2010 by Andre Wiethoff
@@ -51,18 +51,18 @@ From source:
1. Log entry is fine!
2. Log entry is fine!
$ eac_logchecker --json logs/05.log
$ eac_logchecker --json logs/05.log
[{"message": "Log entry is fine!", "status": "OK"}, {"message": "Log entry is fine!", "status": "OK"}]
# Algorithm
## Algorithm
1. Strip the log file of newlines and BOMs.
2. Cut off the existing signature block and (re-)encode the log text back into little-endian UTF-16
3. Encrypt the log file with Rijndael-256:
- in CBC mode
- with a 256-bit block size (most AES implementations hard-code a 128-bit block size)
- all-zeroes IV
- zero-padding
- the hex key `9378716cf13e4265ae55338e940b376184da389e50647726b35f6f341ee3efd9`
* in CBC mode
* with a 256-bit block size (most AES implementations hard-code a 128-bit block size)
* all-zeroes IV
* zero-padding
* the hex key `9378716cf13e4265ae55338e940b376184da389e50647726b35f6f341ee3efd9`
4. XOR together all of the resulting 256-bit ciphertext blocks. You can do it byte-by-byte, it doesn't matter in the end.
5. Output the little-endian representation of the above number, in uppercase hex.
+7
View File
@@ -9,6 +9,8 @@ import pprp
CHECKSUM_MIN_VERSION = ('V1.0', 'beta', '1')
EAC_KEY = '9378716cf13e4265ae55338e940b376184da389e50647726b35f6f341ee3efd9'
__version__ = '0.8.1'
class Log:
def __init__(self, text):
@@ -177,6 +179,11 @@ def main():
parser = argparse.ArgumentParser(
description='Verifies and resigns EAC logs'
)
parser.add_argument(
'--version',
action='version',
version='%(prog)s ' + __version__
)
parser.add_argument('--json', action='store_true', help='Output as JSON')
parser.add_argument('file', type=Path, help='input log file')
+17 -20
View File
@@ -1,11 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
import os
from pathlib import Path
import re
import sys
from shutil import rmtree
@@ -18,17 +18,15 @@ URL = 'https://github.com/OPSnet/eac_logchecker.py'
EMAIL = '[email protected]'
AUTHOR = 'OPS'
REQUIRES_PYTHON = '>=3.5.0'
VERSION = '0.8.0'
here = os.path.abspath(os.path.dirname(__file__))
# Import the README and use it as the long-description.
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
try:
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = '\n' + f.read()
except FileNotFoundError:
long_description = DESCRIPTION
setup_dir = Path(__file__).resolve().parent
version = re.search(
r"__version__ = '(.*)'",
Path(setup_dir, 'eac_logchecker.py').read_text()
)
if version is None:
raise SystemExit("Could not determine version to use")
VERSION = version.group(1)
class UploadCommand(Command):
@@ -51,7 +49,7 @@ class UploadCommand(Command):
def run(self):
try:
self.status('Removing previous builds…')
rmtree(os.path.join(here, 'dist'))
rmtree(Path(setup_dir, 'dist'))
except OSError:
pass
@@ -66,12 +64,11 @@ class UploadCommand(Command):
sys.exit()
# Where the magic happens:
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=long_description,
long_description=Path(setup_dir, 'README.md').read_text(),
long_description_content_type='text/markdown',
author=AUTHOR,
author_email=EMAIL,
@@ -83,18 +80,18 @@ setup(
'eac_logchecker = eac_logchecker:main'
]
},
install_requires=['pprp'],
setup_requires=['pytest-runner'],
install_requires=['pprp==0.2.6'],
tests_require=['pytest'],
license='MIT',
classifiers=[
'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
# $ setup.py publish support.
cmdclass={