Skip to content

Commit 51e5c0c

Browse files
authored
Merge pull request #1 from qubesome/changes
General housekeep, Pure Go pcsc client and support for NitroKey 3
2 parents 0383b0a + 9bfec1f commit 51e5c0c

31 files changed

+851
-39
lines changed

.github/workflows/codeql.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
workflow_dispatch:
8+
schedule:
9+
- cron: '00 1 * * 1'
10+
11+
permissions: {}
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: [ 'go', 'actions' ]
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
31+
- name: Install libpcsc
32+
run: sudo apt-get install -y libpcsclite-dev pcscd pcsc-tools
33+
34+
# Initializes the CodeQL tools for scanning.
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
37+
with:
38+
languages: ${{ matrix.language }}
39+
# xref: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
40+
# xref: https://codeql.github.com/codeql-query-help/go/
41+
queries: security-and-quality
42+
43+
- name: Manual Build
44+
run: go build ./...
45+
46+
- name: Perform CodeQL Analysis
47+
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
48+
with:
49+
category: "/language:${{matrix.language}}"

.github/workflows/scorecard.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Scorecard supply-chain security
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule:
6+
# To guarantee Maintained check is occasionally updated. See
7+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
8+
schedule:
9+
- cron: '0 6 * * 0'
10+
push:
11+
branches: [ "main" ]
12+
13+
# Declare default permissions as read only.
14+
permissions: read-all
15+
16+
jobs:
17+
analysis:
18+
name: Scorecard analysis
19+
runs-on: ubuntu-latest
20+
permissions:
21+
# Needed to upload the results to code-scanning dashboard.
22+
security-events: write
23+
# Needed to publish results and get a badge (see publish_results below).
24+
id-token: write
25+
26+
steps:
27+
- name: "Checkout code"
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
with:
30+
persist-credentials: false
31+
32+
- name: "Run analysis"
33+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
34+
with:
35+
results_file: results.sarif
36+
results_format: sarif
37+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
38+
# - you want to enable the Branch-Protection check on a *public* repository
39+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
40+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
41+
42+
# Public repositories:
43+
# - Publish results to OpenSSF REST API for easy access by consumers
44+
# - Allows the repository to include the Scorecard badge.
45+
# - See https://github.com/ossf/scorecard-action#publishing-results.
46+
publish_results: true
47+
48+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
49+
# format to the repository Actions tab.
50+
- name: "Upload artifact"
51+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
52+
with:
53+
name: SARIF file
54+
path: results.sarif
55+
retention-days: 5
56+
57+
# Upload the results to GitHub's code scanning dashboard (optional).
58+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
59+
- name: "Upload to code-scanning"
60+
uses: github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
61+
with:
62+
sarif_file: results.sarif

.github/workflows/test.yaml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,40 @@
1-
name: test
1+
name: tests
22
on:
33
push:
4-
branches:
5-
- master
6-
- v2
7-
pull_request:
8-
branches:
9-
- master
10-
- v2
4+
5+
permissions: {}
116

127
jobs:
138
build:
14-
strategy:
15-
matrix:
16-
go-version: [1.22.x, 1.23.x]
179
name: Linux
1810
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
1913
steps:
14+
- name: Checkout
15+
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
2016
- name: Set up Go
21-
uses: actions/setup-go@v2
17+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
2218
with:
23-
go-version: ${{ matrix.go-version }}
24-
id: go
25-
- name: Check out code into the Go module directory
26-
uses: actions/checkout@v2
19+
go-version: stable
2720
- name: Install libpcsc
2821
run: sudo apt-get install -y libpcsclite-dev pcscd pcsc-tools
2922
- name: Test
30-
run: "go test -C v2 ./..."
23+
run: make test
24+
3125
build-windows:
32-
strategy:
33-
matrix:
34-
go-version: [1.21.x, 1.22.x]
3526
name: Windows
3627
runs-on: windows-latest
28+
permissions:
29+
contents: read
3730
steps:
31+
- name: Checkout
32+
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2
3833
- name: Set up Go
39-
uses: actions/setup-go@v2
34+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
4035
with:
41-
go-version: ${{ matrix.go-version }}
42-
id: go
43-
- name: Check out code into the Go module directory
44-
uses: actions/checkout@v2
36+
go-version: stable
4537
- name: Test
46-
run: "go build -C v2 ./..."
38+
run: make test
4739
env:
4840
CGO_ENABLED: 0

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test:
2+
go build ./...

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
This is not an officially supported Google product
2-
31
# A Go YubiKey PIV implementation
42

5-
[![Go Reference](https://pkg.go.dev/badge/github.com/go-piv/piv-go/v2/piv.svg)](https://pkg.go.dev/github.com/go-piv/piv-go/v2/piv)
3+
[![Go Reference](https://pkg.go.dev/badge/github.com/qubesome/piv-go/piv.svg)](https://pkg.go.dev/github.com/qubesome/piv-go/piv)
4+
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/qubesome/piv-go/badge)](https://scorecard.dev/viewer/?uri=github.com/qubesome/piv-go)
65

76
YubiKeys implement the PIV specification for managing smart card certificates.
87
This applet is a simpler alternative to GPG for managing asymmetric keys on a
98
YubiKey.
109

11-
This package is an alternative to Paul Tagliamonte's [go-ykpiv](https://github.com/paultag/go-ykpiv),
12-
a wrapper for YubiKey's ykpiv.h C library. This package aims to provide:
10+
This package is a hard fork from [go-piv/piv-go], which was originally an
11+
alternative to Paul Tagliamonte's [go-ykpiv], a wrapper for YubiKey's ykpiv.h
12+
C library. This package aims to provide:
1313

1414
* Better error messages
1515
* Idiomatic Go APIs
@@ -19,7 +19,7 @@ V2 of this package was released in 2024 to support newer kinds of management
1919
keys, and is now the default branch for new features. The import path is:
2020

2121
```
22-
import "github.com/go-piv/piv-go/v2/piv"
22+
import "github.com/qubesome/piv-go/piv"
2323
```
2424

2525
## Examples
@@ -317,3 +317,4 @@ directly use browser U2F challenges for smart cards.
317317

318318
[go-ykpiv]: https://github.com/paultag/go-ykpiv
319319
[openssh-u2f]: https://marc.info/?l=openssh-unix-dev&m=157259802529972&w=2
320+
[go-piv/piv-go]: https://github.com/go-piv/piv-go

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/qubesome/piv-go
2+
3+
go 1.24
File renamed without changes.

0 commit comments

Comments
 (0)