summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-11-25 11:30:25 +0200
committerAlon Levy <alevy@redhat.com>2010-12-09 13:36:19 +0200
commit6d6cf8b8aba48bade5ca32a26b26accb9d012966 (patch)
tree3fb09800cecb98f6025874a3ce84f51d1f65fb70
parentc8354e47fbfff68fb86e9dfdea174461ba5c59d2 (diff)
libcaccard: coding style: s/VCard7816Status/vcard_7816_status_t/
-rw-r--r--cac.c2
-rw-r--r--card_7816.c16
-rw-r--r--card_7816.h4
-rw-r--r--card_7816t.h4
-rw-r--r--vcard_emul.h4
-rw-r--r--vcard_emul_nss.c6
6 files changed, 18 insertions, 18 deletions
diff --git a/cac.c b/cac.c
index deda6f3..e51caec 100644
--- a/cac.c
+++ b/cac.c
@@ -110,7 +110,7 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu,
VCardAppletPrivate *applet_private = NULL;
int size, next;
unsigned char *sign_buffer;
- VCard7816Status status;
+ vcard_7816_status_t status;
applet_private = vcard_get_current_applet_private(card, apdu->a_channel);
ASSERT(applet_private);
diff --git a/card_7816.c b/card_7816.c
index 5c7f487..5635256 100644
--- a/card_7816.c
+++ b/card_7816.c
@@ -13,7 +13,7 @@
* set the status bytes based on the status word
*/
static void
-vcard_response_set_status(VCardResponse *response, VCard7816Status status)
+vcard_response_set_status(VCardResponse *response, vcard_7816_status_t status)
{
unsigned char sw1, sw2;
response->b_status = status; /* make sure the status and swX representations
@@ -94,7 +94,7 @@ vcard_init_buffer_response(VCard *card, unsigned char *buf, int len)
*/
VCardResponse *
vcard_response_new(VCard *card, unsigned char *buf,
- int len, int Le, VCard7816Status status)
+ int len, int Le, vcard_7816_status_t status)
{
VCardResponse *new_response;
@@ -133,7 +133,7 @@ vcard_response_new_bytes(VCard *card, unsigned char *buf, int len, int Le,
* get a new Reponse buffer that only has a status.
*/
static VCardResponse *
-vcard_response_new_status(VCard7816Status status)
+vcard_response_new_status(vcard_7816_status_t status)
{
VCardResponse *new_response;
@@ -207,7 +207,7 @@ vcard_response_delete(VCardResponse *response)
* decode the class bit and set our generic type field, channel, and
* secure messaging values.
*/
-static VCard7816Status
+static vcard_7816_status_t
vcard_apdu_set_class(VCardAPDU *apdu) {
apdu->a_channel = 0;
apdu->a_secure_messaging = 0;
@@ -253,7 +253,7 @@ vcard_apdu_set_class(VCardAPDU *apdu) {
* set the Le and Lc fiels according to table 5 of the
* 7816-4 part 4 spec
*/
-static VCard7816Status
+static vcard_7816_status_t
vcard_apdu_set_length(VCardAPDU *apdu)
{
int L, Le;
@@ -337,7 +337,7 @@ vcard_apdu_set_length(VCardAPDU *apdu)
* values.
*/
VCardAPDU *
-vcard_apdu_new(unsigned char *raw_apdu, int len, VCard7816Status *status)
+vcard_apdu_new(unsigned char *raw_apdu, int len, vcard_7816_status_t *status)
{
VCardAPDU *new_apdu;
@@ -431,7 +431,7 @@ VCARD_RESPONSE_NEW_STATIC_STATUS(VCARD7816_STATUS_ERROR_GENERAL)
* return a response.
*/
VCardResponse *
-vcard_make_response(VCard7816Status status)
+vcard_make_response(vcard_7816_status_t status)
{
VCardResponse *response = NULL;
@@ -551,7 +551,7 @@ vcard7816_vm_process_apdu(VCard *card, VCardAPDU *apdu,
int bytes_to_copy, next_byte_count, count;
VCardApplet *current_applet;
VCardBufferResponse *buffer_response;
- VCard7816Status status;
+ vcard_7816_status_t status;
/* parse the class first */
if (apdu->a_gen_type != VCARD_7816_ISO) {
diff --git a/card_7816.h b/card_7816.h
index 35c903f..4351b1c 100644
--- a/card_7816.h
+++ b/card_7816.h
@@ -13,7 +13,7 @@
*/
/* response from a return buffer and a status */
VCardResponse *vcard_response_new(VCard *card, unsigned char *buf, int len,
- int Le, VCard7816Status status);
+ int Le, vcard_7816_status_t status);
/* response from a return buffer and status bytes */
VCardResponse *vcard_response_new_bytes(VCard *card, unsigned char *buf,
int len, int Le,
@@ -24,7 +24,7 @@ VCardResponse *vcard_response_new_status_bytes(unsigned char sw1,
/* response from just status: NOTE this cannot fail, it will alwyas return a
* valid response, if it can't allocate memory, the response will be
* VCARD7816_STATUS_EXC_ERROR_MEMORY_FAILURE */
-VCardResponse *vcard_make_response(VCard7816Status status);
+VCardResponse *vcard_make_response(vcard_7816_status_t status);
/* create a raw response (status has already been encoded */
VCardResponse *vcard_response_new_data(unsigned char *buf, int len);
diff --git a/card_7816t.h b/card_7816t.h
index 10ed41e..531455c 100644
--- a/card_7816t.h
+++ b/card_7816t.h
@@ -5,11 +5,11 @@
#ifndef CARD_7816T_H
#define CARD_7816T_H 1
-typedef unsigned short VCard7816Status;
+typedef unsigned short vcard_7816_status_t;
struct VCardResponseStruct {
unsigned char *b_data;
- VCard7816Status b_status;
+ vcard_7816_status_t b_status;
unsigned char b_sw1;
unsigned char b_sw2;
int b_len;
diff --git a/vcard_emul.h b/vcard_emul.h
index 5a0053b..0083b33 100644
--- a/vcard_emul.h
+++ b/vcard_emul.h
@@ -33,7 +33,7 @@ typedef struct VCardEmulOptionsStruct VCardEmulOptions;
* return -1 */
int vcard_emul_get_login_count(VCard *card);
/* login into the card, return the 7816 status word (sw2 || sw1) */
-VCard7816Status vcard_emul_login(VCard *card, unsigned char *pin, int pin_len);
+vcard_7816_status_t vcard_emul_login(VCard *card, unsigned char *pin, int pin_len);
/*
* key functions
@@ -41,7 +41,7 @@ VCard7816Status vcard_emul_login(VCard *card, unsigned char *pin, int pin_len);
/* delete a key */
void vcard_emul_delete_key(VCardKey *key);
/* RSA sign/decrypt with the key, signature happens 'in place' */
-VCard7816Status vcard_emul_rsa_op(VCard *card, VCardKey *key,
+vcard_7816_status_t vcard_emul_rsa_op(VCard *card, VCardKey *key,
unsigned char *buffer, int buffer_size);
void vcard_emul_reset(VCard *card, VCardPower power);
diff --git a/vcard_emul_nss.c b/vcard_emul_nss.c
index 66e392f..d7032dd 100644
--- a/vcard_emul_nss.c
+++ b/vcard_emul_nss.c
@@ -195,7 +195,7 @@ vcard_emul_get_nss_key(VCardKey *key)
/*
* Map NSS errors to 7816 errors
*/
-static VCard7816Status
+static vcard_7816_status_t
vcard_emul_map_error(int error)
{
switch (error) {
@@ -217,7 +217,7 @@ vcard_emul_map_error(int error)
}
/* RSA sign/decrypt with the key, signature happens 'in place' */
-VCard7816Status
+vcard_7816_status_t
vcard_emul_rsa_op(VCard *card, VCardKey *key,
unsigned char *buffer, int buffer_size)
{
@@ -259,7 +259,7 @@ vcard_emul_get_login_count(VCard *card)
}
/* login into the card, return the 7816 status word (sw2 || sw1) */
-VCard7816Status
+vcard_7816_status_t
vcard_emul_login(VCard *card, unsigned char *pin, int pin_len)
{
PK11SlotInfo *slot;