summaryrefslogtreecommitdiffstats
path: root/libtomcrypt/misc/pk_get_oid.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtomcrypt/misc/pk_get_oid.c')
-rw-r--r--libtomcrypt/misc/pk_get_oid.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/libtomcrypt/misc/pk_get_oid.c b/libtomcrypt/misc/pk_get_oid.c
index 197d7ae..7b2803f 100644
--- a/libtomcrypt/misc/pk_get_oid.c
+++ b/libtomcrypt/misc/pk_get_oid.c
@@ -10,31 +10,30 @@
#include "tomcrypt.h"
static const oid_st rsa_oid = {
- .OIDlen = 7,
- .OID = { 1, 2, 840, 113549, 1, 1, 1 },
+ .OIDlen = 7,
+ .OID = {1, 2, 840, 113549, 1, 1, 1},
};
static const oid_st dsa_oid = {
- .OIDlen = 6,
- .OID = { 1, 2, 840, 10040, 4, 1 },
+ .OIDlen = 6,
+ .OID = {1, 2, 840, 10040, 4, 1},
};
/*
Returns the OID of the public key algorithm.
@return CRYPT_OK if valid
*/
-int pk_get_oid(int pk, oid_st *st)
+int pk_get_oid(int pk, oid_st * st)
{
- switch (pk) {
- case PKA_RSA:
- memcpy(st, &rsa_oid, sizeof(*st));
- break;
- case PKA_DSA:
- memcpy(st, &dsa_oid, sizeof(*st));
- break;
- default:
- return CRYPT_INVALID_ARG;
- }
- return CRYPT_OK;
+ switch (pk) {
+ case PKA_RSA:
+ memcpy(st, &rsa_oid, sizeof(*st));
+ break;
+ case PKA_DSA:
+ memcpy(st, &dsa_oid, sizeof(*st));
+ break;
+ default:
+ return CRYPT_INVALID_ARG;
+ }
+ return CRYPT_OK;
}
-