[gnome-keyring] [gkm] Rename RSA and DSA mechanism files.
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring] [gkm] Rename RSA and DSA mechanism files.
- Date: Wed, 30 Jun 2010 03:26:01 +0000 (UTC)
commit 02a335fc5dea88ec3932c9afa76f095f153bddcd
Author: Stef Walter <stef memberwebs com>
Date: Mon Jun 28 23:09:03 2010 +0000
[gkm] Rename RSA and DSA mechanism files.
pkcs11/gkm/Makefile.am | 4 +-
pkcs11/gkm/gkm-crypto.c | 24 ++++++++++----------
.../{gkm-mechanism-dsa.c => gkm-dsa-mechanism.c} | 6 ++--
.../{gkm-mechanism-dsa.h => gkm-dsa-mechanism.h} | 12 +++++-----
.../{gkm-mechanism-rsa.c => gkm-rsa-mechanism.c} | 10 ++++----
.../{gkm-mechanism-rsa.h => gkm-rsa-mechanism.h} | 16 ++++++------
pkcs11/gkm/gkm-sexp-key.c | 12 +++++-----
7 files changed, 42 insertions(+), 42 deletions(-)
---
diff --git a/pkcs11/gkm/Makefile.am b/pkcs11/gkm/Makefile.am
index 930a699..bef87e9 100644
--- a/pkcs11/gkm/Makefile.am
+++ b/pkcs11/gkm/Makefile.am
@@ -33,11 +33,10 @@ libgkm_la_SOURCES = \
gkm-dh-mechanism.c gkm-dh-mechanism.h \
gkm-dh-private-key.c gkm-dh-private-key.h \
gkm-dh-public-key.c gkm-dh-public-key.h \
+ gkm-dsa-mechanism.c gkm-dsa-mechanism.h \
gkm-factory.c gkm-factory.h \
gkm-file-tracker.c gkm-file-tracker.h \
gkm-manager.c gkm-manager.h \
- gkm-mechanism-dsa.c gkm-mechanism-dsa.h \
- gkm-mechanism-rsa.c gkm-mechanism-rsa.h \
gkm-memory-store.c gkm-memory-store.h \
gkm-mock.c gkm-mock.h \
gkm-module.c gkm-module.h gkm-module-ep.h \
@@ -46,6 +45,7 @@ libgkm_la_SOURCES = \
gkm-object.c gkm-object.h \
gkm-private-xsa-key.c gkm-private-xsa-key.h \
gkm-public-xsa-key.c gkm-public-xsa-key.h \
+ gkm-rsa-mechanism.c gkm-rsa-mechanism.h \
gkm-secret.c gkm-secret.h \
gkm-secret-key.c gkm-secret-key.h \
gkm-serializable.c gkm-serializable.h \
diff --git a/pkcs11/gkm/gkm-crypto.c b/pkcs11/gkm/gkm-crypto.c
index b77dfe5..9662612 100644
--- a/pkcs11/gkm/gkm-crypto.c
+++ b/pkcs11/gkm/gkm-crypto.c
@@ -24,9 +24,9 @@
#include "gkm-crypto.h"
#include "gkm-aes-mechanism.h"
#include "gkm-dh-mechanism.h"
-#include "gkm-mechanism-dsa.h"
-#include "gkm-mechanism-rsa.h"
+#include "gkm-dsa-mechanism.h"
#include "gkm-null-mechanism.h"
+#include "gkm-rsa-mechanism.h"
#include "gkm-session.h"
#include "gkm-sexp.h"
#include "gkm-sexp-key.h"
@@ -184,11 +184,11 @@ gkm_crypto_encrypt_xsa (gcry_sexp_t sexp, CK_MECHANISM_TYPE mech, CK_BYTE_PTR da
switch (mech) {
case CKM_RSA_PKCS:
g_return_val_if_fail (algorithm == GCRY_PK_RSA, CKR_GENERAL_ERROR);
- rv = gkm_mechanism_rsa_encrypt (sexp, egg_padding_pkcs1_pad_02, data, n_data, encrypted, n_encrypted);
+ rv = gkm_rsa_mechanism_encrypt (sexp, egg_padding_pkcs1_pad_02, data, n_data, encrypted, n_encrypted);
break;
case CKM_RSA_X_509:
g_return_val_if_fail (algorithm == GCRY_PK_RSA, CKR_GENERAL_ERROR);
- rv = gkm_mechanism_rsa_encrypt (sexp, egg_padding_zero_pad, data, n_data, encrypted, n_encrypted);
+ rv = gkm_rsa_mechanism_encrypt (sexp, egg_padding_zero_pad, data, n_data, encrypted, n_encrypted);
break;
default:
/* Again shouldn't be reached */
@@ -238,11 +238,11 @@ gkm_crypto_decrypt_xsa (gcry_sexp_t sexp, CK_MECHANISM_TYPE mech, CK_BYTE_PTR en
switch (mech) {
case CKM_RSA_PKCS:
g_return_val_if_fail (algorithm == GCRY_PK_RSA, CKR_GENERAL_ERROR);
- rv = gkm_mechanism_rsa_decrypt (sexp, egg_padding_pkcs1_unpad_02, encrypted, n_encrypted, data, n_data);
+ rv = gkm_rsa_mechanism_decrypt (sexp, egg_padding_pkcs1_unpad_02, encrypted, n_encrypted, data, n_data);
break;
case CKM_RSA_X_509:
g_return_val_if_fail (algorithm == GCRY_PK_RSA, CKR_GENERAL_ERROR);
- rv = gkm_mechanism_rsa_decrypt (sexp, NULL, encrypted, n_encrypted, data, n_data);
+ rv = gkm_rsa_mechanism_decrypt (sexp, NULL, encrypted, n_encrypted, data, n_data);
break;
default:
/* Again shouldn't be reached */
@@ -293,15 +293,15 @@ gkm_crypto_sign_xsa (gcry_sexp_t sexp, CK_MECHANISM_TYPE mech, CK_BYTE_PTR data,
switch (mech) {
case CKM_RSA_PKCS:
g_return_val_if_fail (algorithm == GCRY_PK_RSA, CKR_GENERAL_ERROR);
- rv = gkm_mechanism_rsa_sign (sexp, egg_padding_pkcs1_pad_01, data, n_data, signature, n_signature);
+ rv = gkm_rsa_mechanism_sign (sexp, egg_padding_pkcs1_pad_01, data, n_data, signature, n_signature);
break;
case CKM_RSA_X_509:
g_return_val_if_fail (algorithm == GCRY_PK_RSA, CKR_GENERAL_ERROR);
- rv = gkm_mechanism_rsa_sign (sexp, egg_padding_zero_pad, data, n_data, signature, n_signature);
+ rv = gkm_rsa_mechanism_sign (sexp, egg_padding_zero_pad, data, n_data, signature, n_signature);
break;
case CKM_DSA:
g_return_val_if_fail (algorithm == GCRY_PK_DSA, CKR_GENERAL_ERROR);
- rv = gkm_mechanism_dsa_sign (sexp, data, n_data, signature, n_signature);
+ rv = gkm_dsa_mechanism_sign (sexp, data, n_data, signature, n_signature);
break;
default:
/* Again shouldn't be reached */
@@ -352,15 +352,15 @@ gkm_crypto_verify_xsa (gcry_sexp_t sexp, CK_MECHANISM_TYPE mech, CK_BYTE_PTR dat
switch (mech) {
case CKM_RSA_PKCS:
g_return_val_if_fail (algorithm == GCRY_PK_RSA, CKR_GENERAL_ERROR);
- rv = gkm_mechanism_rsa_verify (sexp, egg_padding_pkcs1_pad_01, data, n_data, signature, n_signature);
+ rv = gkm_rsa_mechanism_verify (sexp, egg_padding_pkcs1_pad_01, data, n_data, signature, n_signature);
break;
case CKM_RSA_X_509:
g_return_val_if_fail (algorithm == GCRY_PK_RSA, CKR_GENERAL_ERROR);
- rv = gkm_mechanism_rsa_verify (sexp, egg_padding_zero_pad, data, n_data, signature, n_signature);
+ rv = gkm_rsa_mechanism_verify (sexp, egg_padding_zero_pad, data, n_data, signature, n_signature);
break;
case CKM_DSA:
g_return_val_if_fail (algorithm == GCRY_PK_DSA, CKR_GENERAL_ERROR);
- rv = gkm_mechanism_dsa_verify (sexp, data, n_data, signature, n_signature);
+ rv = gkm_dsa_mechanism_verify (sexp, data, n_data, signature, n_signature);
break;
default:
/* Again shouldn't be reached */
diff --git a/pkcs11/gkm/gkm-mechanism-dsa.c b/pkcs11/gkm/gkm-dsa-mechanism.c
similarity index 96%
rename from pkcs11/gkm/gkm-mechanism-dsa.c
rename to pkcs11/gkm/gkm-dsa-mechanism.c
index 832bf9b..6558504 100644
--- a/pkcs11/gkm/gkm-mechanism-dsa.c
+++ b/pkcs11/gkm/gkm-dsa-mechanism.c
@@ -22,7 +22,7 @@
#include "config.h"
#include "gkm-crypto.h"
-#include "gkm-mechanism-dsa.h"
+#include "gkm-dsa-mechanism.h"
#include "gkm-session.h"
#include "gkm-sexp.h"
#include "gkm-sexp-key.h"
@@ -35,7 +35,7 @@
*/
CK_RV
-gkm_mechanism_dsa_sign (gcry_sexp_t sexp, CK_BYTE_PTR data, CK_ULONG n_data,
+gkm_dsa_mechanism_sign (gcry_sexp_t sexp, CK_BYTE_PTR data, CK_ULONG n_data,
CK_BYTE_PTR signature, CK_ULONG_PTR n_signature)
{
gcry_sexp_t ssig, splain;
@@ -95,7 +95,7 @@ gkm_mechanism_dsa_sign (gcry_sexp_t sexp, CK_BYTE_PTR data, CK_ULONG n_data,
}
CK_RV
-gkm_mechanism_dsa_verify (gcry_sexp_t sexp, CK_BYTE_PTR data, CK_ULONG n_data,
+gkm_dsa_mechanism_verify (gcry_sexp_t sexp, CK_BYTE_PTR data, CK_ULONG n_data,
CK_BYTE_PTR signature, CK_ULONG n_signature)
{
gcry_sexp_t ssig, splain;
diff --git a/pkcs11/gkm/gkm-mechanism-dsa.h b/pkcs11/gkm/gkm-dsa-mechanism.h
similarity index 85%
rename from pkcs11/gkm/gkm-mechanism-dsa.h
rename to pkcs11/gkm/gkm-dsa-mechanism.h
index 5a8afe5..2b625ba 100644
--- a/pkcs11/gkm/gkm-mechanism-dsa.h
+++ b/pkcs11/gkm/gkm-dsa-mechanism.h
@@ -19,8 +19,8 @@
* 02111-1307, USA.
*/
-#ifndef GKM_MECHANISM_DSA_H_
-#define GKM_MECHANISM_DSA_H_
+#ifndef GKM_DSA_MECHANISM_H_
+#define GKM_DSA_MECHANISM_H_
#include "gkm-types.h"
@@ -30,20 +30,20 @@
#include <gcrypt.h>
-static const CK_MECHANISM_TYPE GKM_CRYPTO_DSA_MECHANISMS[] = {
+static const CK_MECHANISM_TYPE GKM_DSA_MECHANISMS[] = {
CKM_DSA
};
-CK_RV gkm_mechanism_dsa_sign (gcry_sexp_t sexp,
+CK_RV gkm_dsa_mechanism_sign (gcry_sexp_t sexp,
CK_BYTE_PTR data,
CK_ULONG n_data,
CK_BYTE_PTR signature,
CK_ULONG_PTR n_signature);
-CK_RV gkm_mechanism_dsa_verify (gcry_sexp_t sexp,
+CK_RV gkm_dsa_mechanism_verify (gcry_sexp_t sexp,
CK_BYTE_PTR data,
CK_ULONG n_data,
CK_BYTE_PTR signature,
CK_ULONG n_signature);
-#endif /* GKM_MECHANISM_DSA_H_ */
+#endif /* GKM_DSA_MECHANISM_H_ */
diff --git a/pkcs11/gkm/gkm-mechanism-rsa.c b/pkcs11/gkm/gkm-rsa-mechanism.c
similarity index 95%
rename from pkcs11/gkm/gkm-mechanism-rsa.c
rename to pkcs11/gkm/gkm-rsa-mechanism.c
index 372eb1f..072dc2d 100644
--- a/pkcs11/gkm/gkm-mechanism-rsa.c
+++ b/pkcs11/gkm/gkm-rsa-mechanism.c
@@ -21,7 +21,7 @@
#include "config.h"
-#include "gkm-mechanism-rsa.h"
+#include "gkm-rsa-mechanism.h"
#include "gkm-sexp.h"
#include "egg/egg-libgcrypt.h"
@@ -32,7 +32,7 @@
*/
CK_RV
-gkm_mechanism_rsa_encrypt (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR data,
+gkm_rsa_mechanism_encrypt (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR data,
CK_ULONG n_data, CK_BYTE_PTR encrypted, CK_ULONG_PTR n_encrypted)
{
gcry_sexp_t splain, sdata;
@@ -78,7 +78,7 @@ gkm_mechanism_rsa_encrypt (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR dat
}
CK_RV
-gkm_mechanism_rsa_decrypt (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR encrypted,
+gkm_rsa_mechanism_decrypt (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR encrypted,
CK_ULONG n_encrypted, CK_BYTE_PTR data, CK_ULONG_PTR n_data)
{
gcry_sexp_t splain, sdata;
@@ -126,7 +126,7 @@ gkm_mechanism_rsa_decrypt (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR enc
}
CK_RV
-gkm_mechanism_rsa_sign (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR data,
+gkm_rsa_mechanism_sign (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR data,
CK_ULONG n_data, CK_BYTE_PTR signature, CK_ULONG_PTR n_signature)
{
gcry_sexp_t ssig, sdata;
@@ -171,7 +171,7 @@ gkm_mechanism_rsa_sign (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR data,
}
CK_RV
-gkm_mechanism_rsa_verify (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR data,
+gkm_rsa_mechanism_verify (gcry_sexp_t sexp, EggPadding padding, CK_BYTE_PTR data,
CK_ULONG n_data, CK_BYTE_PTR signature, CK_ULONG n_signature)
{
gcry_sexp_t ssig, sdata;
diff --git a/pkcs11/gkm/gkm-mechanism-rsa.h b/pkcs11/gkm/gkm-rsa-mechanism.h
similarity index 87%
rename from pkcs11/gkm/gkm-mechanism-rsa.h
rename to pkcs11/gkm/gkm-rsa-mechanism.h
index dd89aa3..0339e31 100644
--- a/pkcs11/gkm/gkm-mechanism-rsa.h
+++ b/pkcs11/gkm/gkm-rsa-mechanism.h
@@ -19,8 +19,8 @@
* 02111-1307, USA.
*/
-#ifndef GKM_MECHANISM_RSA_H_
-#define GKM_MECHANISM_RSA_H_
+#ifndef GKM_RSA_MECHANISM_H_
+#define GKM_RSA_MECHANISM_H_
#include "gkm-crypto.h"
#include "gkm-types.h"
@@ -31,37 +31,37 @@
#include <gcrypt.h>
-static const CK_MECHANISM_TYPE GKM_CRYPTO_RSA_MECHANISMS[] = {
+static const CK_MECHANISM_TYPE GKM_RSA_MECHANISMS[] = {
CKM_RSA_PKCS,
CKM_RSA_X_509
};
-CK_RV gkm_mechanism_rsa_encrypt (gcry_sexp_t sexp,
+CK_RV gkm_rsa_mechanism_encrypt (gcry_sexp_t sexp,
EggPadding padding,
CK_BYTE_PTR data,
CK_ULONG n_data,
CK_BYTE_PTR encrypted,
CK_ULONG_PTR n_encrypted);
-CK_RV gkm_mechanism_rsa_decrypt (gcry_sexp_t sexp,
+CK_RV gkm_rsa_mechanism_decrypt (gcry_sexp_t sexp,
EggPadding padding,
CK_BYTE_PTR encrypted,
CK_ULONG n_encrypted,
CK_BYTE_PTR data,
CK_ULONG_PTR n_data);
-CK_RV gkm_mechanism_rsa_sign (gcry_sexp_t sexp,
+CK_RV gkm_rsa_mechanism_sign (gcry_sexp_t sexp,
EggPadding padding,
CK_BYTE_PTR data,
CK_ULONG n_data,
CK_BYTE_PTR signature,
CK_ULONG_PTR n_signature);
-CK_RV gkm_mechanism_rsa_verify (gcry_sexp_t sexp,
+CK_RV gkm_rsa_mechanism_verify (gcry_sexp_t sexp,
EggPadding padding,
CK_BYTE_PTR data,
CK_ULONG n_data,
CK_BYTE_PTR signature,
CK_ULONG n_signature);
-#endif /* GKM_MECHANISM_RSA_H_ */
+#endif /* GKM_RSA_MECHANISM_H_ */
diff --git a/pkcs11/gkm/gkm-sexp-key.c b/pkcs11/gkm/gkm-sexp-key.c
index 1752fa6..8128ed4 100644
--- a/pkcs11/gkm/gkm-sexp-key.c
+++ b/pkcs11/gkm/gkm-sexp-key.c
@@ -24,8 +24,8 @@
#include "pkcs11/pkcs11.h"
#include "gkm-attributes.h"
-#include "gkm-mechanism-dsa.h"
-#include "gkm-mechanism-rsa.h"
+#include "gkm-dsa-mechanism.h"
+#include "gkm-rsa-mechanism.h"
#include "gkm-sexp-key.h"
#include "gkm-util.h"
@@ -94,11 +94,11 @@ gkm_sexp_key_real_get_attribute (GkmObject *base, GkmSession *session, CK_ATTRIB
case CKA_ALLOWED_MECHANISMS:
switch (gkm_sexp_key_get_algorithm (self)) {
case GCRY_PK_RSA:
- return gkm_attribute_set_data (attr, (CK_VOID_PTR)GKM_CRYPTO_RSA_MECHANISMS,
- sizeof (GKM_CRYPTO_RSA_MECHANISMS));
+ return gkm_attribute_set_data (attr, (CK_VOID_PTR)GKM_RSA_MECHANISMS,
+ sizeof (GKM_RSA_MECHANISMS));
case GCRY_PK_DSA:
- return gkm_attribute_set_data (attr, (CK_VOID_PTR)GKM_CRYPTO_DSA_MECHANISMS,
- sizeof (GKM_CRYPTO_DSA_MECHANISMS));
+ return gkm_attribute_set_data (attr, (CK_VOID_PTR)GKM_DSA_MECHANISMS,
+ sizeof (GKM_DSA_MECHANISMS));
default:
g_return_val_if_reached (CKR_GENERAL_ERROR);
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]