GithubHelp home page GithubHelp logo

classicvalues / yubihsm-shell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yubico/yubihsm-shell

0.0 1.0 0.0 1020 KB

yubihsm-shell and libyubihsm

Home Page: https://developers.yubico.com/yubihsm-shell/

License: Apache License 2.0

CMake 6.69% C 90.54% Shell 2.15% PowerShell 0.47% Batchfile 0.15%

yubihsm-shell's Introduction

YubiHSM Shell

This repository contains most of the components used to interact with the YubiHSM 2 at both a user-facing and programmatic level.

The available components are:

  • libyubihsm — C library to expose low- and high-level functions to interact with a YubiHSM

  • yubihsm-shell — thin wrapper around libyubihsm providing both an interactive and command-line interface to a YubiHSM

  • yubihsm-pkcs11 — PKCS#11 module using libyubihsm

  • yubihsm-wrap — command-line tool to create encrypted objects (wraps) that can be imported in the YubiHSM

  • libykhsmauth — C library for using the YubiKey HSM Auth application

  • yubihsm-auth — command-line tool to use the YubiKey HSM Auth application

Dependencies

  • cmake

  • cppcheck (optional)

  • gcov and lcov (optional)

  • gengetopt

  • help2man (optional)

  • libcrypto

  • libcurl

  • libedit

  • libusb

  • libpcsclite-dev

  • llvm/clang and friends

  • pkg-config

  • pre-commit

Documentation

Documentation for this project and the YubiHSM2 in general can be found on Yubico’s developers website.

pre-commit

This repository uses pre-commit.

$ pre-commit install

Building

$ mkdir build && cd build
$ cmake ..
$ make

Note that ninja builds are available as well:

$ mkdir build && cd build
$ cmake -GNinja ..
$ ninja

The binaries will be located in build directory. To install them on the system, run make install. Note that this step may require admin privileges on some systems (tex. sudo on Linux)

Important
Building from source on Windows should be made with the source from the source release package and not directly from the cloned repository. This is due to the gengetopt library not being available for Windows.

Manpages are built by default using help2man. It is possible to skip this step with:

$ mkdir build && cd build
$ cmake -DWITHOUT_MANPAGES=1 ..
$ make

It is possible to build the libraries and binaries with static linking, this can be enabled with:

$ mkdir build && cd build
$ cmake -DENABLE_STATIC=1 ..
$ make

Linting

There is a cppcheck target that runs the source through cppcheck

$ make cppcheck

Testing

PKCS#11 tests can be run using pkcs11test.

The tool must be already built, and the path to the resulting binary must be in your PATH, or PKCS11TEST_PATH must be set.

The programs found in the /examples directory are also used as tests.

The tests can be run via

$ make test

Or using ctest directly

$ ctest

By default the tests expect a local connector running at http://127.0.0.1:12345. A different connector for the tests can be specified by setting the DEFAULT_CONNECTOR_URL environment variable. For example, to run tests using direct USB (i.e., without a connector) use

$ DEFAULT_CONNECTOR_URL="yhusb://" ctest

If you are building yubihsm-shell with ninja, the following is available:

$ ninja test

The test output can be found in …​/yubihsm-shell/build/Testing/Temporary/LastTest{,sFailed}.log.

Direct command-line output can be obtained with

$ ctest -V

Coverage

Code coverage is provided courtesy of lcov and CMake-codecov. This currently only works with make and not with ninja.

Enable coverage with

$ cmake -DENABLE_COVERAGE=1 ..

You can then build the project normally and run some executables (for example running the tests with make test).

At this point coverage evaluation can be generated with gcov/lcov related targets. For example

$ make lcov

will generate a single HTML report in ./lcov/html/all_targets/index.html

License

 Copyright 2015-2018 Yubico AB

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

yubihsm-shell's People

Contributors

klali avatar a-dma avatar aveenismail avatar qpernil avatar notdpate avatar juikim avatar spoonincode avatar jakuje avatar osterlad avatar mouse07410 avatar jeamland avatar edmcnierney avatar jeanpaulgalea avatar marissanishimoto avatar robn avatar kento-m avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.