Skip to content

Update with improvements #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

30 changes: 30 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Copyright (c) 2017 Microchip Technology Inc. and its subsidiaries (Microchip). All rights reserved.

You are permitted to use this software and its derivatives with Microchip
products. Redistribution and use in source and binary forms, with or without
modification, is permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. The name of Microchip may not be used to endorse or promote products derived
from this software without specific prior written permission.

4. This software may only be redistributed and used in connection with a
Microchip integrated circuit.

THIS SOFTWARE IS PROVIDED BY MICROCHIP "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL MICROCHIP BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
118 changes: 0 additions & 118 deletions Makefile

This file was deleted.

97 changes: 65 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,81 @@

#CryptoAuthentication OpenSSL Engine
Configuration:

##Overview
This is an OpenSSL Engine implementation using ATECC508A for ECC key storage, ECDSA sign/verify, ECDH, and FIPS Random Number Generator
Most of the configuration of the library can be done in lib/openssl/eccx08_engine.h or via defines during build

The implementation integrates the [Atmel ATECC508A](http://www.atmel.com/devices/atecc508a.aspx) into the [OpenSSL ENGINE API](http://openssl.org/docs/manmaster/crypto/engine.html) to provide secure hardware key storage, [CAVP certified random numbers](http://csrc.nist.gov/groups/STM/cavp/documents/aes/aesval.html), P256 ECDSA & ECDH, and secure storage for data.
The exception to this is in eccx08_platform.c where key slots are defaulted

This project will integrate the key creation and import capabilities of the ATECC508A into the OpenSSL key creation and certificate creation process.
If the ATCA_OPENSSL_ENGINE_STATIC_CONFIG define is set to 1 then device and signer certificate definitions will
have to be linked into the library at build.

Also, secure key storage for RSA keys are implemented using the encrypted read/write feature of the ATECC508A.
e.g. see the line in the makefile: #LIBATECCSSL_OBJECTS += cert_def_1_signer.c cert_def_2_signer.c

###Supported Cipher Suites
Many ECDH(E)-ECDSA and ECDHE-RSA cipher suites are supported with the OpenSSL Engine for ATECC508A implementation.

Details for cipher suites can be found [here](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/Supported-Ciphers)
Makfile:

##Download and Make
Build instructions for Linux can be found on the Wiki pages associate with this project.
The makefile included in this archive is fairly basic and is not what one would consider appropriate for a package
so there is likely some manual configuration that would be needed at this stage

See: [Compile OpenSSL Engine for ATECC508A on Linux](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/Linux:-Compile-OpenSSL-Engine-for-ATECC508A)

##Platform Integration
Follow the platform integration instructions found [here](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/Integrate-ATECC508A-onto-Your-Platform)
To build the library:

##Unit Tests
Unit testing is provided for both integration of the ATECC508A device and OpenSSL Examples.
For details see:
[Platform Integration Tests](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/ATECC508A-Integration-Tests)
[OpenSSL Engine Tests & Examples](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/Tests-And-Examples)
> make libateccssl

Source-Level Documentation
Full Doxygen source-level documentation is provided.
See: /docs/doxygen/html/index.html
To run the test program:

##Web Server Setup
The OpenSSL Engine for ATECC508A can also be configured.
See Details [here](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/Web-Server-For-The-Web-Browser).
> make test

##Wiki Topics:
- [Linux Development Setup](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/Linux:-Development-Setup)
- [Compiling on Linux](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/Linux:-Compile-OpenSSL-Engine-for-ATECC508A)
- [Debugging on Linux](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/Linux:-Debugging)
- [ATECC508A Integration](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/ATECC508A:-Platform-Integration)
- [ATECC508A Certificate Provisioning](http://www.atmel.com/tools/at88ckeccroot-signer.aspx)
- [Tests and Examples](https://github.com/AtmelCSO/cryptoauth-openssl-engine/wiki/Tests:-OpenSSL-Tests-and-Examples)
To extract certificates (if the engine is added to the openssl.cnf file):

> openssl engine ateccx08 -t -post GET_DEVICE_CERT:./device.der
> openssl engine ateccx08 -t -post GET_SIGNER_CERT:./signer.der

Otherwise you'll have to use an interactive openssl session (see openssl engine -h and engine -vvv for details)

> openssl

OpenSSL> engine dynamic -pre SO_PATH:/<full path to libeccssl.so> -pre LIST_ADD:1 -pre ID:ateccx08 -pre LOAD
OpenSSL> engine ateccx08 -t -post GET_DEVICE_CERT:./device.der
OpenSSL> engine ateccx08 -t -post GET_SIGNER_CERT:./signer.der

Then to verify the certs:
> openssl x509 -in device.der -inform der -text -noout
> openssl x509 -in signer.der -inform der -text -noout

To set up your openssl.cnf file

Find which openssl.cnf file your instance is using you can:

> openssl version -a | grep OPENSSLDIR
OPENSSLDIR: "/usr/lib/ssl"

will tell you the base location where openssl is looking for the openssl.cnf file. It may be a symbolic link to another location

> ls -l /usr/lib/ssl
lrwxrwxrwx 1 root root 14 Apr 24 15:22 certs -> /etc/ssl/certs
lrwxrwxrwx 1 root root 20 Jan 31 05:53 openssl.cnf -> /etc/ssl/openssl.cnf

To set up the openssl.cnf to use the engine:

# At the top:

openssl_conf = openssl_init

# Append to the end:

[ openssl_init ]
engines = engine_section

[ engine_section ]
ateccx08 = ateccx08_config

[ ateccx08_config ]
engine_id = ateccx08
# Or if you sym link the libateccssl.so to the engine directory the next line is not needed
dynamic_path = <full path to libateccssl.so>
device_key_slot = 0
init = 0

To use the engine in an application you can reference the openssl tests (test/openssl/test_engine.c) but the basic principle is that
if the openssl.cnf file is configured correctly all an application really needs to do is add a call to OPENSSL_config if it is not already
doing so and then to decide what functionality that the application wants and register it.
35 changes: 0 additions & 35 deletions cmd

This file was deleted.

69 changes: 0 additions & 69 deletions cmd_openssl

This file was deleted.

Loading