Blame src/gen-mech-list.sh

Packit aea12f
#!/bin/sh
Packit aea12f
Packit aea12f
# Copyright (C) 2017-2018 Red Hat, Inc.
Packit aea12f
#
Packit aea12f
# This file is part of GnuTLS.
Packit aea12f
#
Packit aea12f
# GnuTLS is free software; you can redistribute it and/or modify it
Packit aea12f
# under the terms of the GNU General Public License as published by the
Packit aea12f
# Free Software Foundation; either version 3 of the License, or (at
Packit aea12f
# your option) any later version.
Packit aea12f
#
Packit aea12f
# GnuTLS is distributed in the hope that it will be useful, but
Packit aea12f
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit aea12f
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit aea12f
# General Public License for more details.
Packit aea12f
#
Packit aea12f
# You should have received a copy of the GNU General Public License
Packit aea12f
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
Packit aea12f
Packit aea12f
HEADER=`pkg-config --cflags-only-I p11-kit-1|awk '{print $1}'|sed 's/-I//g'`
Packit aea12f
HEADER="${HEADER}/p11-kit/pkcs11.h"
Packit aea12f
Packit aea12f
echo "const char *mech_list[] = {"
Packit aea12f
Packit aea12f
# Exclude duplicate and uninteresting entries
Packit aea12f
EXCLUDED="(CKM_VENDOR_DEFINED\s|CKM_CAST128_MAC\s|CKM_CAST128_KEY_GEN\s|CKM_CAST128_ECB\s|CKM_CAST128_CBC\s|CKM_CAST128_MAC_GENERAL\s|CKM_CAST128_CBC_PAD\s|CKM_PBE_MD5_CAST128_CBC\s|CKM_PBE_SHA1_CAST128_CBC\s|CKM_EC_KEY_PAIR_GEN\s)"
Packit aea12f
Packit aea12f
TMPFILE=list.$$.tmp
Packit aea12f
Packit aea12f
cat ${HEADER}|grep -E "define\sCKM_"|grep -vE "${EXCLUDED}"|awk '{print "\t["$3"] = \""$2"\","}' |sort -u
Packit aea12f
Packit aea12f
echo "};"
Packit aea12f