Blame src/gen-mech-list.sh

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