diff options
| author | Jack Magne <jmagne@dhcp-16-206.sjc.redhat.com> | 2016-11-15 17:37:07 -0800 |
|---|---|---|
| committer | Jack Magne <jmagne@dhcp-16-206.sjc.redhat.com> | 2016-11-22 16:00:40 -0800 |
| commit | 4027d3caa872f2950dae0b3d2208c0c54ceb4a4c (patch) | |
| tree | e34cc65fd7d80e914f93bea144a5c85c172ba068 /base/tps-client/src/include/apdu | |
| parent | 52694cd6acf81446623b6d24947d8d3afdc8536c (diff) | |
| download | pki-4027d3caa872f2950dae0b3d2208c0c54ceb4a4c.tar.gz pki-4027d3caa872f2950dae0b3d2208c0c54ceb4a4c.tar.xz pki-4027d3caa872f2950dae0b3d2208c0c54ceb4a4c.zip | |
Change lifecycle at end of enrollment if it is not already set.
TPS throws "err=6" when attempting to format and enroll G&D Cards.
https://bugzilla.redhat.com/show_bug.cgi?id=1320283
This fix addresses this bug , but also:
Fixes this issue:
Applet upgrade during rekey operation results in formatted token.
Also, it takes care of a related issue where the new apdu needed for the
lifecycle state causes the testing tool "tpslcient" to seg fault.
The fix here is a minimal fix to have tpsclient return an error when it gets
this apdu it can't handle, instead of crashing.
Diffstat (limited to 'base/tps-client/src/include/apdu')
| -rw-r--r-- | base/tps-client/src/include/apdu/APDU.h | 3 | ||||
| -rw-r--r-- | base/tps-client/src/include/apdu/Get_Lifecycle_APDU.h | 58 |
2 files changed, 60 insertions, 1 deletions
diff --git a/base/tps-client/src/include/apdu/APDU.h b/base/tps-client/src/include/apdu/APDU.h index cfb66ad19..e4b8b2a26 100644 --- a/base/tps-client/src/include/apdu/APDU.h +++ b/base/tps-client/src/include/apdu/APDU.h @@ -76,7 +76,8 @@ enum APDU_Type { APDU_IMPORT_KEY_ENC = 25, APDU_SET_ISSUERINFO = 26, APDU_GET_ISSUERINFO = 27, - APDU_GENERATE_KEY_ECC = 28 + APDU_GENERATE_KEY_ECC = 28, + APDU_GET_LIFECYCLE = 29 }; class APDU diff --git a/base/tps-client/src/include/apdu/Get_Lifecycle_APDU.h b/base/tps-client/src/include/apdu/Get_Lifecycle_APDU.h new file mode 100644 index 000000000..e8e1e9ad4 --- /dev/null +++ b/base/tps-client/src/include/apdu/Get_Lifecycle_APDU.h @@ -0,0 +1,58 @@ +/* --- 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 GET_LIFECYCLE_APDU_H +#define GET_LIFECYCLE_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 <config.h> +#endif /* AUTOTOOLS_CONFIG_H */ +#endif /* HAVE_CONFIG_H */ + +#include "main/Base.h" +#include "apdu/APDU.h" + +#ifdef XP_WIN32 +#define TPS_PUBLIC __declspec(dllexport) +#else /* !XP_WIN32 */ +#define TPS_PUBLIC +#endif /* !XP_WIN32 */ + +class Get_Lifecycle_APDU : public APDU +{ + public: + TPS_PUBLIC Get_Lifecycle_APDU(); + TPS_PUBLIC ~Get_Lifecycle_APDU(); + TPS_PUBLIC APDU_Type GetType(); + TPS_PUBLIC void GetEncoding(Buffer &data); +}; + +#endif /* LIFECYCLE_APDU_H */ |
