1#!/bin/sh 2# 3# Copyright 2017-2023 The OpenSSL Project Authors. All Rights Reserved. 4# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5# 6# Licensed under the OpenSSL license (the "License"). You may not use 7# this file except in compliance with the License. You can obtain a copy 8# in the file LICENSE in the source distribution or at 9# https://www.openssl.org/source/license.html 10 11# 12# OpenSSL external testing using the Python Cryptography module 13# 14set -e 15set -x 16 17O_EXE=`pwd`/$BLDTOP/apps 18O_BINC=`pwd`/$BLDTOP/include 19O_SINC=`pwd`/$SRCTOP/include 20O_LIB=`pwd`/$BLDTOP 21 22export PATH=$O_EXE:$PATH 23export LD_LIBRARY_PATH=$O_LIB:$LD_LIBRARY_PATH 24 25# Check/Set openssl version 26OPENSSL_VERSION=`openssl version | cut -f 2 -d ' '` 27 28echo "------------------------------------------------------------------" 29echo "Testing OpenSSL using Python Cryptography:" 30echo " CWD: $PWD" 31echo " SRCTOP: $SRCTOP" 32echo " BLDTOP: $BLDTOP" 33echo " OpenSSL version: $OPENSSL_VERSION" 34echo "------------------------------------------------------------------" 35 36cd $SRCTOP 37 38# Create a python virtual env and activate 39rm -rf venv-cryptography 40python -m venv venv-cryptography 41. ./venv-cryptography/bin/activate 42 43cd pyca-cryptography 44 45echo "------------------------------------------------------------------" 46echo "Building cryptography" 47echo "------------------------------------------------------------------" 48LDFLAGS="-L$O_LIB" CFLAGS="-I$O_BINC -I$O_SINC" pip install .[test] 49pip install -e vectors 50 51echo "------------------------------------------------------------------" 52echo "Running tests" 53echo "------------------------------------------------------------------" 54 55pytest -n auto tests --wycheproof-root=../wycheproof 56 57cd ../ 58deactivate 59rm -rf venv-cryptography 60 61exit 0 62 63