[pkg-opensc-commit] [opensc] 273/295: Add _sc_card_add_generic for registering secret key algorithms

Eric Dorland eric at moszumanska.debian.org
Sat Jun 24 21:11:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository opensc.

commit 0576ccce0c1e95e4eea074101e041495599c7910
Author: Timo Teräs <timo.teras at iki.fi>
Date:   Wed Apr 12 10:37:56 2017 +0300

    Add _sc_card_add_generic for registering secret key algorithms
---
 src/libopensc/card.c     | 13 +++++++++++++
 src/libopensc/internal.h |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/src/libopensc/card.c b/src/libopensc/card.c
index 9a8b5f6..194634b 100644
--- a/src/libopensc/card.c
+++ b/src/libopensc/card.c
@@ -952,6 +952,19 @@ int _sc_card_add_algorithm(sc_card_t *card, const sc_algorithm_info_t *info)
 	return SC_SUCCESS;
 }
 
+int _sc_card_add_symmetric_alg(sc_card_t *card, unsigned int algorithm,
+			       unsigned int key_length, unsigned long flags)
+{
+	sc_algorithm_info_t info;
+
+	memset(&info, 0, sizeof(info));
+	info.algorithm = algorithm;
+	info.key_length = key_length;
+	info.flags = flags;
+
+	return _sc_card_add_algorithm(card, &info);
+}
+
 int  _sc_card_add_ec_alg(sc_card_t *card, unsigned int key_length,
 			unsigned long flags, unsigned long ext_flags,
 			struct sc_object_id *curve_oid)
diff --git a/src/libopensc/internal.h b/src/libopensc/internal.h
index 5d64fd6..33f64cf 100644
--- a/src/libopensc/internal.h
+++ b/src/libopensc/internal.h
@@ -128,6 +128,8 @@ scconf_block *_sc_match_atr_block(sc_context_t *ctx, struct sc_card_driver *driv
 int _sc_match_atr(struct sc_card *card, struct sc_atr_table *table, int *type_out);
 
 int _sc_card_add_algorithm(struct sc_card *card, const struct sc_algorithm_info *info);
+int _sc_card_add_symmetric_alg(sc_card_t *card, unsigned int algorithm,
+			       unsigned int key_length, unsigned long flags);
 int _sc_card_add_rsa_alg(struct sc_card *card, unsigned int key_length,
 		unsigned long flags, unsigned long exponent);
 int _sc_card_add_ec_alg(struct sc_card *card, unsigned int key_length,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/opensc.git



More information about the pkg-opensc-commit mailing list