From 75e1c66acb48e67951fc0ce5680328773fe837ae Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Wed, 15 Aug 2012 14:06:08 -0400 Subject: https://fedorahosted.org/pki/ticket/237 ECC support for tpsclient two parameters are added in the config file (see enroll.tps.ec for example): slotnamefile - this points to a file that contains the slot name. The reason why the slot name goes into another file instead of the conf file is because the existing conf file uses spaces for deliminator and I don't want to change the usage (and QE's tests) by changing it to something else. tokpasswod is the tokebn password This ECC feature requires the up-coming ECC supporting TPS to trigger. Testing of the ECC specific areas requires the availability of such ECC TPS. Without it, one can test with the old RSA method to see if it's broken. --- base/tps/src/include/apdu/APDU.h | 3 +- base/tps/src/include/apdu/Generate_Key_ECC_APDU.h | 60 +++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 base/tps/src/include/apdu/Generate_Key_ECC_APDU.h (limited to 'base/tps/src/include') diff --git a/base/tps/src/include/apdu/APDU.h b/base/tps/src/include/apdu/APDU.h index e0f778a19..cfb66ad19 100644 --- a/base/tps/src/include/apdu/APDU.h +++ b/base/tps/src/include/apdu/APDU.h @@ -75,7 +75,8 @@ enum APDU_Type { APDU_IMPORT_KEY = 24, APDU_IMPORT_KEY_ENC = 25, APDU_SET_ISSUERINFO = 26, - APDU_GET_ISSUERINFO = 27 + APDU_GET_ISSUERINFO = 27, + APDU_GENERATE_KEY_ECC = 28 }; class APDU diff --git a/base/tps/src/include/apdu/Generate_Key_ECC_APDU.h b/base/tps/src/include/apdu/Generate_Key_ECC_APDU.h new file mode 100644 index 000000000..c1a4e3764 --- /dev/null +++ b/base/tps/src/include/apdu/Generate_Key_ECC_APDU.h @@ -0,0 +1,60 @@ +/* --- BEGIN COPYRIGHT BLOCK --- + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + * + * Copyright (C) 2007 Red Hat, Inc. + * All rights reserved. + * --- END COPYRIGHT BLOCK --- + */ + +#ifndef GENERATE_KEY_ECC_APDU_H +#define GENERATE_KEY_ECC_APDU_H + +#ifdef HAVE_CONFIG_H +#ifndef AUTOTOOLS_CONFIG_H +#define AUTOTOOLS_CONFIG_H + +/* Eliminate warnings when using Autotools */ +#undef PACKAGE_BUGREPORT +#undef PACKAGE_NAME +#undef PACKAGE_STRING +#undef PACKAGE_TARNAME +#undef PACKAGE_VERSION + +#include +#endif /* AUTOTOOLS_CONFIG_H */ +#endif /* HAVE_CONFIG_H */ + +#include "main/Base.h" +#include "main/Buffer.h" +#include "apdu/APDU.h" + +#ifdef XP_WIN32 +#define TPS_PUBLIC __declspec(dllexport) +#else /* !XP_WIN32 */ +#define TPS_PUBLIC +#endif /* !XP_WIN32 */ + +class Generate_Key_ECC_APDU : public APDU +{ + public: + TPS_PUBLIC Generate_Key_ECC_APDU (BYTE p1, BYTE p2, BYTE alg, + int keysize, BYTE option, + BYTE type, Buffer &wrapped_challenge, Buffer &key_check); + TPS_PUBLIC ~Generate_Key_ECC_APDU(); + TPS_PUBLIC APDU_Type GetType(); +}; + +#endif /* GENERATE_KEY_ECC_APDU_H */ -- cgit