Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
c3c5f2d
Add criteria to check if card capability SC_CARD_CAP_PROTECTED_AUTHEN…
Mar 12, 2021
b9c0add
update configure.ac to be less noisy
pprindeville Mar 30, 2021
0df0f80
IASECC: log any APDU Incorrect parameters
vjardin Mar 28, 2021
1a36663
IASECC/CPX: Avoid APDU Incorrect Parameters
vjardin Mar 28, 2021
545e47b
preparation for 0.22.0
frankmorgner Apr 6, 2021
edb7ed2
pkcs11-tool: disable wrap/unwrap test until OpenSC#1796 is resolved
carblue Apr 7, 2021
a83069b
updated to Microsoft Cryptographic Provider Development Kit (CPDK) Ve…
frankmorgner Apr 8, 2021
991bb8a
add CPDK include flags
frankmorgner Apr 8, 2021
4b3c6de
.travis: Fail if tests fail
Jakuje Apr 6, 2021
cae5c71
oberthur: Handle 1B OIDs
Jakuje Apr 6, 2021
ef17b3f
tests: Fix comparison for osx
Jakuje Apr 6, 2021
7d274a0
travis-ci: Try to run the tests on Ubuntu 20 (Focal Fossa)
popovec Apr 1, 2021
dd48fac
travis CI: testsuite fix (tests/test-pkcs11-tool-allowed-mechanisms.sh)
popovec Apr 6, 2021
d6ec00c
cardos: Add ATR for CardOS 5.4
Jakuje Apr 14, 2021
344ac0a
iasec: use proper printf format specifiers for size_t
marschap Apr 20, 2021
4912f05
use OpenPACE 1.1.1
frankmorgner Apr 25, 2021
396cbc4
IASECC/CPX: set default flags
vjardin Mar 25, 2021
39b4472
IASECC/CPX: export pkcs15init for missing features
vjardin Mar 27, 2021
1372868
IASECC/CPX: enable calls thru pkcs15-iasecc.c
vjardin Mar 22, 2021
544aa4c
IASECC/CPX: Fix up prkeyinfo/algo_ref
vjardin Mar 22, 2021
405ecfc
IASECC: proper pkcs15init of Algo_refs
vjardin Mar 27, 2021
fcd2e66
IASECC/CPX: fix APDU errors for SE get data
vjardin Mar 29, 2021
e3a3722
IASECC/CPX: Fix SDO path
vjardin Mar 29, 2021
2063a1d
silince generation of files
frankmorgner Apr 26, 2021
75f24d2
regenerated egk-tool cmdline
frankmorgner Apr 26, 2021
4ecb4b3
updated documentation
frankmorgner Apr 26, 2021
3f19991
updated NEWS
frankmorgner Apr 26, 2021
e93bd39
IASECC/Gemalto: add support
vjardin Apr 26, 2021
a21bcf4
IASECC/Gemalto: register application
vjardin Mar 29, 2021
1961168
Fix for #2283 C_Sign fails ECDSA when card can do HASH on card
dengert Apr 1, 2021
570fc56
Remove the SC_SEC_ENV_FILE_REF_PRESENT flag for Rutoken ECP cards
Apr 8, 2021
32004e7
added missing files to distribution
frankmorgner Apr 30, 2021
50eaa6b
fix possible access outside the array.
ihsinme May 2, 2021
9866352
pkcs15-tool: Write data objects in binary mode
divinehawk May 3, 2021
06ac408
travis: Invoke distcheck to make sure all needed files are packaged
Jakuje May 1, 2021
835cee2
tests: Add correct path to enable out-of-source build
Jakuje May 1, 2021
d0b847c
tests: Remove files after disclean
Jakuje May 1, 2021
613b56e
Add correct prefix on the clang-tidy commandline
Jakuje May 5, 2021
2f145f5
Workaround for broken Ubuntu Focal images
Jakuje May 6, 2021
2ea5ed8
Fix 'make check' when make --jobs= is used
LudovicRousseau May 5, 2021
35a8a1d
pkcs11.h: avoid C++ comments
alonbl May 7, 2021
072c64a
Adds Gemalto IDPrime v4
kirichkov May 6, 2021
5ae0ef4
Sets card->name for IDPrime v3 and v4 cards
kirichkov May 6, 2021
ca01d2c
Code style changes
kirichkov May 6, 2021
46c50dc
CPx: add registration for Windows/minidrivers
vjardin May 5, 2021
f0c059e
ATRMask: better describe the rule to be applied
vjardin May 7, 2021
180737d
tests: minidriver runtime PINCODE
vjardin May 4, 2021
5256bc3
tests: minidriver using T0 or T1
vjardin May 4, 2021
8dfafe4
Fix 2340 pkcs15-sec.c wrong test
dengert May 15, 2021
f1bc07d
Fix piv-tool on wondows
dengert May 12, 2021
48a11c0
Update piv-tool man pages for AES
dengert May 18, 2021
f356d30
Enable ed25519/curve25519 support for Yubikey 5
ya-isakov Apr 3, 2021
29410c1
Make OpenPGP curves to be a pointer to OpenPGP 3.4 curves list
ya-isakov Apr 6, 2021
23dc52c
Fixed OpenPGP logic for comparing OIDs
ya-isakov Apr 7, 2021
fc08818
OpenPGP: Fix read/write certs with Ed25519/X25519 public key
ya-isakov Apr 5, 2021
0b45e78
idprime: Fix RSA-PKCS mechanism with hashing on card
Jakuje May 17, 2021
e4cf0e7
Basic unit test for secure messaging functions
Jakuje May 4, 2021
12be677
Drop duplicate -Werror build flag (already used unless --disable-strict)
Jakuje May 5, 2021
07f5e63
tests: verify secure messaging functions work as expected
Jakuje May 6, 2021
1b92501
sm: Rewrite to use non-deprecated OpenSSL 3.0 API
Jakuje May 6, 2021
fd96d2c
Do not use deprecated ERR_load_ERR_strings() with OpenSSL 3.0
Jakuje May 6, 2021
a69ab7c
tests: Fix context for the asn1 test
Jakuje May 6, 2021
a8a4bdd
p11test: Debug level from commandline
Jakuje May 12, 2021
8e41348
p11test: Add new mechanisms from softhsm
Jakuje May 12, 2021
33426df
p11test: Do not return on warnings for (X)EDDSA keys
Jakuje May 21, 2021
465375b
Fixing command-line option names in error messages
hablutzel1 May 21, 2021
ffd6e2a
p11test: Expect DERIVE to be set on both private and public key
Jakuje May 21, 2021
fc2fecc
Use const types for RSA and EC_KEY
Jakuje May 24, 2021
9d1a214
pkcs11: Undefine internal typedef and remove its usage
Jakuje Jun 2, 2021
9be6dc6
pkcs11: Update the version to 3.0 (unused anywhere though)
Jakuje Jun 2, 2021
151583c
C_Initialize() must copy CK_C_INITIALIZE_ARGS
smuehlst Dec 5, 2020
c42792c
Merge pull request #2343 from Jakuje/ossl3v1
frankmorgner Jun 7, 2021
aebebac
p11test: Use OPTIONAL_OPENSSL_CFLAGS
dengert Jun 11, 2021
2f94a6b
pkcs11-tool: allow setting CKA_EXTRACTABLE during keypair generation
a-dma Jun 23, 2021
fd6b64b
Update NEWS with recently merged changes
Jakuje Jun 25, 2021
aa6574b
New rc published
Jakuje Jun 29, 2021
d90048e
Merge pull request #2357 from a-dma/p11_extractable
frankmorgner Jul 5, 2021
d34e84c
eidenv: Avoid memory leak
Jakuje Jun 18, 2021
9a5a008
pkcs15-tool: Update the logic to make it more clear for some dumb sta…
Jakuje Jun 18, 2021
99656de
avoid limited size when logging data
frankmorgner Jun 11, 2021
bc9b9df
Do not use EVP_PKEY_get0() for EC_KEY handling
Jakuje Jul 15, 2021
1b32909
Move the cifuzz to separate file
Jakuje Jun 30, 2021
e683c53
Migrate some tests to Github Actions
Jakuje Jun 30, 2021
5d33873
CI: Avoid warnings from tput
Jakuje Jul 6, 2021
f43d3f8
Add Javacard tests and mingw build to Github Actions
Jakuje Jul 8, 2021
01cf556
github-actions: Unbreak artifacts pushing
Jakuje Aug 3, 2021
d47f42b
README: Update badges and links from travis
Jakuje Aug 3, 2021
8453c0d
Skip openpgp test for now
Jakuje Aug 3, 2021
456ac56
PIV Improved parsing of data from the card
dengert Jul 14, 2021
445a632
Remove unused code
dengert Jul 15, 2021
c6a9b56
PIV-improved parsing - fix two whilhspace nits
dengert Aug 3, 2021
1e43a6a
Make sure the dist creates tarball for pushing artifacts
Jakuje Aug 4, 2021
3048156
Execute push-artifacts on macos
Jakuje Aug 4, 2021
68b7efb
github actions: Unbreak migw builds
Jakuje Aug 4, 2021
b67261a
Upload also tarball as a build artifact
Jakuje Aug 4, 2021
4c923c6
log.c - fix newline - Fixes:#2378
dengert Aug 6, 2021
7d315b5
Merge pull request #2379 from dengert/Fix-new-line
frankmorgner Aug 9, 2021
6431f69
pkcs11-spy: Fix crash for pMechanism=NULL
vesajaaskelainen Jul 17, 2021
1991fa2
[merge] new output for pMechas
vesajaaskelainen Aug 3, 2021
7007eda
pkcs11-spy: fix random crash in print_generic()
vesajaaskelainen Aug 3, 2021
1b344a4
pkcs11-spy: Fix C_GetFunctionList() crash with NULL argument
vesajaaskelainen Aug 4, 2021
63a5a49
pkcs11-spy: Match formatting for C_OpenSession()
vesajaaskelainen Aug 4, 2021
cababca
pkcs11-spy: Fix C_OpenSession() crash with phSession=NULL argument
vesajaaskelainen Aug 4, 2021
e97fec4
pkcs11-spy: Fix attribute displaying crash in case pTemplate=NULL
vesajaaskelainen Aug 4, 2021
c902e19
prepare 0.22.0 release
Jakuje Aug 9, 2021
549359e
jcop: Remove old driver
xhanulik Aug 3, 2021
ac7b02e
jcop: Remove pkcs15init support
xhanulik Aug 3, 2021
28e7f35
MioCOS: Remove old driver
xhanulik Aug 3, 2021
5582cd2
MioCOS: Remove pkcs15init support
xhanulik Aug 3, 2021
088a8a1
Fix pkcs11-tool and test-pkcs11-tool-test-threads.sh
dengert Aug 17, 2021
1b10f79
test-actions-2 vsmartcard-0.8
dengert Aug 21, 2021
adbd9f0
pkcs11-tool: support verifying HMAC signatures
Aug 17, 2021
d102449
test: add a an HMAC C_Sign/C_Verify test
Aug 17, 2021
5dd6805
get hex name for unknown objects
lo1ol Apr 12, 2021
98f6d77
move definition of name variable at the beginning of block. Move defi…
lo1ol Apr 13, 2021
58bc344
prepare package signing for macOS
frankmorgner Aug 20, 2021
2eaa250
actions: monitor macos specific changes
frankmorgner Aug 22, 2021
fe04f5a
actions: monitor linux workflow changes
frankmorgner Aug 22, 2021
b4e41c6
actions: monitor cifuzz changes
frankmorgner Aug 22, 2021
5e5f85e
CI: monitor commands in scripts
frankmorgner Aug 24, 2021
23f22fd
ci: corrected position of workflow for deleting macos keys
frankmorgner Aug 24, 2021
282440d
ci: add signing keys when NOT in PR
frankmorgner Aug 24, 2021
27751b9
ci: fixed macos cleanup
frankmorgner Aug 24, 2021
b5393ea
ci: unify shell flags
frankmorgner Aug 25, 2021
e591735
ci: pass code signing credentials in for build
frankmorgner Aug 26, 2021
703183e
Merge pull request #2394 from frankmorgner/macos_action
frankmorgner Aug 30, 2021
1078812
sc_pkcs15_compute_signature: allow arbitrary length input
frankmorgner Apr 28, 2021
042f2d1
pkcs11: allow arbitrary length for signing
frankmorgner Apr 28, 2021
5503b8e
use __FILE_NAME__ instead of __FILE__ if possible
frankmorgner Apr 29, 2021
789f161
introduce sc_mem_secure_clear_free()
frankmorgner Apr 30, 2021
e59d652
clear memory when finishing signature computation
frankmorgner Aug 24, 2021
6d580ac
fixed possible memory leak
frankmorgner Aug 24, 2021
4aed677
ci: no need to focus on non-PRs
frankmorgner Aug 30, 2021
9191cee
workaround invalid syntax, exit push_artifacts early instead
frankmorgner Aug 30, 2021
59bd3c1
ci: only push artifacts with opensc/opensc
frankmorgner Aug 31, 2021
f44564b
Disable old cards drivers
xhanulik Aug 18, 2021
05090d8
Add boilerplate for disabling old pkcs15 emulators
xhanulik Aug 5, 2021
91240fe
Update documentation for disabling pkcs15 emulators
xhanulik Aug 5, 2021
0bc9a58
Add unit tests for filtering pkcs15 emulators
xhanulik Aug 12, 2021
da29c3c
Disable pkcs15 emulators for Actalis and TC CardOS
xhanulik Aug 18, 2021
146e3e1
Improve logging for filtering pkcs15 emulators
xhanulik Aug 26, 2021
3c5cd24
Use LoadLibrarEx with LOAD_WITH_ALTERED_SEARCH_PATH for absolute paths
qpernil Apr 9, 2021
df0fd52
Link with shlwapi
qpernil Apr 9, 2021
2566845
Add shlwapi.lib to makefile instead
qpernil Jun 22, 2021
29d3b69
github actions: Improve PIV testing
Jakuje Aug 10, 2021
60cd935
github actions: Add ix86 compilation target to catch 32bit issues
Jakuje Aug 10, 2021
73d4760
github actions: Install 32b softhsm
Jakuje Aug 10, 2021
4e5552f
.github: Share code handling pcscd restarts and cleanup
Jakuje Aug 19, 2021
5888a27
.github: Try to wait for pcscd up to 30 seconds
Jakuje Aug 19, 2021
defc0c8
.github: Fix directory structure
Jakuje Aug 19, 2021
5439231
tests: Simplify CAC setup to prevent hangs
Jakuje Aug 20, 2021
93eeb60
tests: Avoid calling systemctl comands when the systemd is not handli…
Jakuje Aug 20, 2021
1e7c36a
.github: Add missing dependency
Jakuje Aug 20, 2021
646b1d0
.github: Try harder to prevent interactive prompts
Jakuje Aug 20, 2021
bf4c838
.github: Do not fail on existing directories
Jakuje Aug 20, 2021
7b39f3c
.github: Clarify comment
Jakuje Aug 24, 2021
a97c907
.github: openpgp works now
Jakuje Sep 1, 2021
053420f
.github: Try my jcardsim fork with fix for tests
Jakuje Sep 1, 2021
8fc650e
Removed unused CI configurations
Jakuje Aug 19, 2021
c1be55a
pkcs11-tool: Fix typo in the comment
Jakuje Aug 10, 2021
eb34f61
tools: Avoid maybe-uninitialized warnings from gcc11
Jakuje Aug 11, 2021
53aa0f6
tests: Use explicit pkcs11 library in thread test
Jakuje Aug 10, 2021
3127ad2
p11test: Fix invalid format string on 32b architectures
Jakuje Aug 10, 2021
8bdd759
pkcs11-tool: Add SHA256 test
Jakuje Aug 11, 2021
8fc822a
pkcs11: Do not add MD5 and RIPEMD160 algorithms in FIPS mode
Jakuje Aug 11, 2021
eb8a381
pkcs11-tool: Skip unsupported digests in FIPS mode
Jakuje Aug 11, 2021
465d0d7
pkcs11-tool: Support extractable and private flags when generating se…
Jakuje Aug 20, 2021
a6e9488
Ignore test artifacts
Jakuje Aug 20, 2021
2a4a609
sm: Avoid memory leaks on errors of OpenSSL 3.0 code
Jakuje Aug 20, 2021
de75600
sm: Initialize tmplen
Jakuje Aug 20, 2021
134f6dd
openpgp: Avoid memory leak
Jakuje Aug 20, 2021
e8c07dc
p11test: Fix copy&paste error
Jakuje Aug 20, 2021
c486755
idprime: Avoid uninitialized key_reference on unknown card versions
Jakuje Aug 20, 2021
6556e25
pkcs11-spy: Avoid NULL pointer dereference
Jakuje Aug 20, 2021
dc9a152
libopensc: Avoid NULL pointer dereference with wrong arguments
Jakuje Aug 20, 2021
3983eb5
pkcs11-tool: Avoid referencing variable in a structure that goes out …
Jakuje Aug 20, 2021
5f9d04a
p11test: Avoid double free on error
Jakuje Aug 20, 2021
2495e90
tests: Avoid memory leak from tests
Jakuje Aug 20, 2021
1a8c5be
p11test: Avoid memory leak on error
Jakuje Aug 20, 2021
e963651
idprime: idprime_process_index() will read objects bigger than 256 bytes
maxrd2 May 9, 2021
08ab1b7
idprime: implement get_challenge and flag RNG support
maxrd2 May 11, 2021
683cbe0
Detect hotplug events for both reader and card
Jakuje Jun 29, 2021
097acbc
p11test: Add missing switch to the usage
Jakuje Aug 27, 2021
dbd49bc
pkcs11-tool: Print human-redable profile names
Jakuje Aug 27, 2021
cf042ef
p11test: Test also longer messages for EdDSA
Jakuje Aug 27, 2021
0531499
Describe how to run tests in container environment closest to Github …
Jakuje Aug 20, 2021
82588d8
pkcs11: Add a todo note
Jakuje Sep 1, 2021
a6a4472
CONTRIBUTING: Use relative link
Jakuje Sep 3, 2021
876898b
Add mingw container for testing
Jakuje Sep 8, 2021
f0afd17
.github: Default to verbose make
Jakuje Sep 8, 2021
a00ead5
libopensc: Unbreak build with mingw
Jakuje Sep 8, 2021
b585183
meta: add clang-format formatting configuration
martinpaljak Mar 21, 2019
64b624e
Try github actions for clang format
Jakuje Apr 24, 2020
24285bd
Use shorter lines and align consecutive macros
Jakuje Apr 24, 2020
6e35f8a
.clang-format: Skip LLVM default options to clarify differences in Op…
Jakuje May 14, 2020
5c4257b
Add clang-format hints to avoid reformating struct tables
Jakuje May 14, 2020
49e3ebb
clang-format: Support continuous indentation using tabs
Jakuje May 14, 2020
ef8ad9d
Add missing includes
Jakuje May 15, 2020
03441ca
.gitignore: Add missing binaries
Jakuje May 15, 2020
deb5afd
Make sure cmocka.h is included as a last one
Jakuje May 15, 2020
d7fbe43
Sort includes to match clang-format
Jakuje Dec 14, 2020
cafc07d
Whitespace cleanup according to clang-format
Jakuje Dec 14, 2020
778465a
Add known revisions to ignore for git blame
Jakuje Dec 14, 2020
9bf0af4
Document formatting style
Jakuje Sep 7, 2021
667e018
.github: Improve task name and invoke rules
Jakuje Sep 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
BasedOnStyle: LLVM
# defaults from LLVM
# BreakBeforeBraces: Attach
# AllowShortIfStatementsOnASingleLine: Never
# IndentCaseLabels: false
# AlignAfterOpenBracket: Align
# AlignTrailingComments: true
# MaxEmptyLinesToKeep: 1
# ReflowComments: falsedefault
# SortIncludes: true
# BreakBeforeBinaryOperators: None
# BraceWrapping:
# AfterClass: false
# AfterControlStatement: false
# AfterFunction: false
# AfterNamespace: false
# BeforeCatch: false
# BeforeElse: false
# IndentBraces: false

# OpenSC modifications
IndentWidth: 8
# This is ugly, but hopefully allowing to use tabs for continuation indentation
ContinuationIndentWidth: 8
UseTab: ForContinuationAndIndentation
AlignConsecutiveMacros: true
ColumnLimit: 110

BraceWrapping:
AfterEnum: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
63 changes: 63 additions & 0 deletions .github/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

set -ex -o xtrace

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig;

if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
if [ "$GITHUB_BASE_REF" == "master" ]; then
./bootstrap.ci -s "-pr$PR_NUMBER"
else
./bootstrap.ci -s "$GITHUB_BASE_REF-pr$PR_NUMBER"
fi
else
BRANCH=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
if [ "$BRANCH" == "master" ]; then
./bootstrap
else
./bootstrap.ci -s "$BRANCH"
fi
fi

if [ "$RUNNER_OS" == "macOS" ]; then
./MacOSX/build
exit $?
fi

if [ "$1" == "mingw" -o "$1" == "mingw32" ]; then
if [ "$1" == "mingw" ]; then
HOST=x86_64-w64-mingw32
elif [ "$1" == "mingw32" ]; then
HOST=i686-w64-mingw32
fi
unset CC
unset CXX
./configure --host=$HOST --with-completiondir=/tmp --disable-openssl --disable-readline --disable-zlib --disable-notify --prefix=$PWD/win32/opensc || cat config.log;
make -j 2 V=1
# no point in running tests on mingw
else
if [ "$1" == "ix86" ]; then
export CFLAGS="-m32"
export LDFLAGS="-m32"
fi
# normal procedure
./configure --disable-dependency-tracking
make -j 2 V=1
# 32b build has some issues to find openssl correctly
if [ "$1" != "ix86" ]; then
make check
fi
fi

# this is broken in old ubuntu
if [ "$1" == "dist" ]; then
make distcheck
make dist
fi

sudo make install
if [ "$1" == "mingw" -o "$1" == "mingw32" ]; then
# pack installed files
wine "C:/Program Files/Inno Setup 5/ISCC.exe" win32/OpenSC.iss
fi
7 changes: 7 additions & 0 deletions .github/cleanup-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -ex -o xtrace

if [ -n "$PASS_SECRETS_TAR_ENC" ]; then
.github/remove_signing_key.sh
fi
7 changes: 6 additions & 1 deletion .github/push_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

set -ex -o xtrace

if [ -z "$GH_TOKEN" ]; then
exit 0
fi

BUILDPATH=${PWD}
BRANCH="`git log --max-count=1 --date=short --abbrev=8 --pretty=format:"%cd_%h"`"

git clone --single-branch https://${GH_TOKEN}@github.com/OpenSC/Nightly.git > /dev/null 2>&1
cd Nightly
pushd Nightly
git checkout -b "${BRANCH}"

for file in ${BUILDPATH}/win32/Output/OpenSC*.exe ${BUILDPATH}/opensc*.tar.gz ${BUILDPATH}/OpenSC*.dmg ${BUILDPATH}/OpenSC*.msi ${BUILDPATH}/OpenSC*.zip
Expand All @@ -33,3 +37,4 @@ do
git pull --rebase origin --strategy-option ours "${BRANCH}"
i=$(( $i + 1 ))
done
popd
39 changes: 39 additions & 0 deletions .github/restart-pcscd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash -e

# This file is made to be sourced into other test scripts and not executed
# manually because it sets trap to restore pcscd to working state

# register cleanup handler
function pcscd_cleanup {
echo "Process terminated: resetting pcscd"
sudo pkill pcscd
if which systemctl; then
sudo systemctl start pcscd.socket
fi
}
trap pcscd_cleanup EXIT


# stop the pcscd service and run it from console to see possible errors
if which systemctl; then
sudo systemctl stop pcscd.service pcscd.socket
else
sudo pkill pcscd || echo "no pcscd process was running"
fi
sudo /usr/sbin/pcscd -f 2>&1 | sed -e 's/^/pcscd: /;' &


# Try to wait up to 30 seconds for pcscd to come up and create PID file
for ((i=1;i<=30;i++)); do
echo "Waiting for pcscd to start: $i s"
if [ -f "/var/run/pcscd/pcscd.pid" ]; then
break
fi
sleep 1
done


# if it did not come up, warn, but continue
if [ ! -f "/var/run/pcscd/pcscd.pid" ]; then
echo "WARNING: The pcscd pid file does not exist ... trying anyway"
fi
Binary file removed .github/secrets.tar.enc
Binary file not shown.
Binary file added .github/secrets.tar.gpg
Binary file not shown.
30 changes: 30 additions & 0 deletions .github/setup-java.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -ex -o xtrace

# Select the right java
sudo update-java-alternatives -s java-1.8.0-openjdk-amd64
sudo update-alternatives --get-selections | grep ^java
export PATH="/usr/lib/jvm/java-8-openjdk-amd64/bin/:$PATH"
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
env | grep -i openjdk

# VSmartcard
./.github/setup-vsmartcard.sh

# Javacard SDKs
if [ ! -d "oracle_javacard_sdks" ]; then
git clone https://github.com/martinpaljak/oracle_javacard_sdks.git
fi
export JC_HOME=$PWD/oracle_javacard_sdks/jc222_kit
export JC_CLASSIC_HOME=$PWD/oracle_javacard_sdks/jc305u3_kit

# jCardSim
if [ ! -d "jcardsim" ]; then
git clone https://github.com/Jakuje/jcardsim.git
fi
pushd jcardsim
env | grep -i openjdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
mvn initialize && mvn clean install
popd
54 changes: 54 additions & 0 deletions .github/setup-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

set -ex -o xtrace

# Generic dependencies
DEPS="docbook-xsl xsltproc gengetopt help2man pcscd check pcsc-tools libtool make autoconf autoconf-archive automake pkg-config openssl git"

# 64bit or 32bit dependencies
if [ "$1" == "ix86" ]; then
sudo dpkg --add-architecture i386
DEPS="$DEPS gcc-multilib libpcsclite-dev:i386 libcmocka-dev:i386 libssl-dev:i386 zlib1g-dev:i386 libreadline-dev:i386 softhsm2:i386"
else
DEPS="$DEPS libpcsclite-dev libcmocka-dev libssl-dev zlib1g-dev libreadline-dev softhsm2"
fi

if [ "$1" == "clang-tidy" ]; then
DEPS="$DEPS clang-tidy"
elif [ "$1" == "cac" ]; then
DEPS="$DEPS libglib2.0-dev libnss3-dev gnutls-bin libusb-dev libudev-dev flex libnss3-tools"
elif [ "$1" == "oseid" ]; then
DEPS="$DEPS socat gawk xxd"
elif [ "$1" == "piv" -o "$1" == "isoapplet" -o "$1" == "gidsapplet" -o "$1" == "openpgp" ]; then
if [ "$1" == "piv" ]; then
DEPS="$DEPS cmake"
fi
DEPS="$DEPS ant openjdk-8-jdk maven"
elif [ "$1" == "mingw" -o "$1" == "mingw32" ]; then
DEPS="$DEPS wine wine32 xvfb wget"
sudo dpkg --add-architecture i386
if [ "$1" == "mingw" ]; then
DEPS="$DEPS binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64 mingw-w64"
elif [ "$1" == "mingw32" ]; then
DEPS="$DEPS binutils-mingw-w64-i686 gcc-mingw-w64-i686"
fi
fi

# make sure we do not get prompts
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
sudo apt-get update
sudo apt-get install -y build-essential $DEPS

if [ "$1" == "mingw" -o "$1" == "mingw32" ]; then
if [ ! -f "$(winepath 'C:/Program Files/Inno Setup 5/ISCC.exe')" ]; then
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
export DISPLAY=:99.0
[ -d isetup ] || mkdir isetup
pushd isetup
[ -f isetup-5.5.6.exe ] || wget http://files.jrsoftware.org/is/5/isetup-5.5.6.exe
sleep 5 # make sure the X server is ready ?
wine isetup-5.5.6.exe /SILENT /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART
popd
fi
fi
33 changes: 33 additions & 0 deletions .github/setup-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -ex -o xtrace

brew install automake

# gengetopt
curl https://ftp.gnu.org/gnu/gengetopt/gengetopt-2.23.tar.xz -L --output gengetopt-2.23.tar.xz
tar xfj gengetopt-2.23.tar.xz
pushd gengetopt-2.23
./configure && make
sudo make install
popd

# help2man
curl https://ftp.gnu.org/gnu/help2man/help2man-1.47.16.tar.xz -L --output help2man-1.47.16.tar.xz
tar xjf help2man-1.47.16.tar.xz
pushd help2man-1.47.16
./configure && make
sudo make install
popd

# openSCToken
export PATH="/usr/local/opt/ccache/libexec:$PATH"
git clone https://github.com/frankmorgner/OpenSCToken.git
sudo rm -rf /Library/Developer/CommandLineTools;

if [ -n "$PASS_SECRETS_TAR_ENC" ]; then
gpg --quiet --batch --yes --decrypt --passphrase="$PASS_SECRETS_TAR_ENC" --output .github/secrets.tar .github/secrets.tar.gpg
.github/add_signing_key.sh;
else
unset CODE_SIGN_IDENTITY INSTALLER_SIGN_IDENTITY;
fi
11 changes: 11 additions & 0 deletions .github/setup-vsmartcard.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -ex -o xtrace

if [ ! -d "vsmartcard" ]; then
git clone https://github.com/frankmorgner/vsmartcard.git
fi
pushd vsmartcard/virtualsmartcard
git checkout -b tag-0.8 virtualsmartcard-0.8
autoreconf -vis && ./configure && make -j2 && sudo make install
popd
47 changes: 47 additions & 0 deletions .github/test-cac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

set -ex -o xtrace

# install the opensc
sudo make install
export LD_LIBRARY_PATH=/usr/local/lib

# VSmartcard
./.github/setup-vsmartcard.sh

# libcacard
if [ ! -d "libcacard" ]; then
git clone https://gitlab.freedesktop.org/spice/libcacard.git
fi
pushd libcacard
./autogen.sh --prefix=/usr && make -j2 && sudo make install
popd

# prepare pcscd
. .github/restart-pcscd.sh

# virt_cacard
if [ ! -d "virt_cacard" ]; then
git clone https://github.com/Jakuje/virt_cacard.git
fi
pushd virt_cacard
./autogen.sh && ./configure && make
./setup-softhsm2.sh
export SOFTHSM2_CONF=$PWD/softhsm2.conf
# register cleanup function on exit
trap "pkill -9 virt_cacard" EXIT
./virt_cacard 2>&1 | sed -e 's/^/virt_cacard: /;' &
popd

# run the tests
pushd src/tests/p11test/
sleep 5
./p11test -s 0 -p 12345678 -o virt_cacard.json
popd

# cleanup -- this would break later uses of pcscd
pushd vsmartcard/virtualsmartcard
sudo make uninstall
popd

diff -u3 src/tests/p11test/virt_cacard{_ref,}.json
33 changes: 33 additions & 0 deletions .github/test-gidsapplet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -ex -o xtrace

# install the opensc
sudo make install
export LD_LIBRARY_PATH=/usr/local/lib

# setup java stuff
. .github/setup-java.sh

# GidsApplet
git clone https://github.com/vletoux/GidsApplet.git;
javac -classpath jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar GidsApplet/src/com/mysmartlogon/gidsApplet/*.java;
echo "com.licel.jcardsim.card.applet.0.AID=A000000397425446590201" > gids_jcardsim.cfg;
echo "com.licel.jcardsim.card.applet.0.Class=com.mysmartlogon.gidsApplet.GidsApplet" >> gids_jcardsim.cfg;
echo "com.licel.jcardsim.card.ATR=3B80800101" >> gids_jcardsim.cfg;
echo "com.licel.jcardsim.vsmartcard.host=localhost" >> gids_jcardsim.cfg;
echo "com.licel.jcardsim.vsmartcard.port=35963" >> gids_jcardsim.cfg;


# prepare pcscd
. .github/restart-pcscd.sh


# start the applet and run couple of commands against that
java -noverify -cp GidsApplet/src/:jcardsim/target/jcardsim-3.0.5-SNAPSHOT.jar com.licel.jcardsim.remote.VSmartCard gids_jcardsim.cfg >/dev/null &
PID=$!;
sleep 5;
opensc-tool --card-driver default --send-apdu 80b80000190bA0000003974254465902010bA00000039742544659020100;
opensc-tool -n;
gids-tool --initialize --pin 123456 --admin-key 000000000000000000000000000000000000000000000000 --serial 00000000000000000000000000000000;
kill -9 $PID
Loading