diff --git a/scd/apdu.c b/scd/apdu.c index fceb4f396..0d9ef3d0c 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id$ */ #include diff --git a/scd/apdu.h b/scd/apdu.h index f31e42e3d..e0f50b72b 100644 --- a/scd/apdu.h +++ b/scd/apdu.h @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id$ */ #ifndef APDU_H diff --git a/scd/app-common.h b/scd/app-common.h index c15f174bf..f54f6da92 100644 --- a/scd/app-common.h +++ b/scd/app-common.h @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id$ */ #ifndef GNUPG_SCD_APP_COMMON_H diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c index 6f9837c90..86c907d1d 100644 --- a/scd/app-openpgp.c +++ b/scd/app-openpgp.c @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id$ */ #include diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c index 287a8d87d..0a876f0bc 100644 --- a/scd/ccid-driver.c +++ b/scd/ccid-driver.c @@ -51,6 +51,8 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $Id$ */ diff --git a/scd/ccid-driver.h b/scd/ccid-driver.h index 9cb23253b..82feed5c9 100644 --- a/scd/ccid-driver.h +++ b/scd/ccid-driver.h @@ -50,6 +50,8 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $Id$ */ #ifndef CCID_DRIVER_H diff --git a/scd/iso7816.c b/scd/iso7816.c index cbb314eb2..4861466c1 100644 --- a/scd/iso7816.c +++ b/scd/iso7816.c @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id$ */ #include @@ -103,6 +105,17 @@ map_sw (int sw) return gpg_error (ec); } +/* Map a status word from the APDU layer to a gpg-error code. */ +gpg_error_t +iso7816_map_sw (int sw) +{ + /* All APDU functions should return 0x9000 on success but for + historical reasons of the implementation some return 0 to + indicate success. We allow for that here. */ + return sw? map_sw (sw) : 0; +} + + /* This function is specialized version of the SELECT FILE command. SLOT is the card and reader as created for example by apdu_open_reader (), AID is a buffer of size AIDLEN holding the diff --git a/scd/iso7816.h b/scd/iso7816.h index 8f2b150e6..b9ba1800b 100644 --- a/scd/iso7816.h +++ b/scd/iso7816.h @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + * $Id$ */ #ifndef ISO7816_H @@ -25,6 +27,8 @@ #include "cardglue.h" #endif +gpg_error_t iso7816_map_sw (int sw); + gpg_error_t iso7816_select_application (int slot, const char *aid, size_t aidlen); gpg_error_t iso7816_select_file (int slot, int tag, int is_dir,