mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
X.509: parse public key parameters from x509 for akcipher
Some public key algorithms (like EC-DSA) keep in parameters field
important data such as digest and curve OIDs (possibly more for
different EC-DSA variants). Thus, just setting a public key (as
for RSA) is not enough.
Append parameters into the key stream for akcipher_set_{pub,priv}_key.
Appended data is: (u32) algo OID, (u32) parameters length, parameters
data.
This does not affect current akcipher API nor RSA ciphers (they could
ignore it). Idea of appending parameters to the key stream is by Herbert
Xu.
Cc: David Howells <[email protected]>
Cc: Denis Kenzior <[email protected]>
Cc: [email protected]
Signed-off-by: Vitaly Chikunov <[email protected]>
Reviewed-by: Denis Kenzior <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
83bc029996
commit
f1774cb895
8 changed files with 136 additions and 29 deletions
|
|
@ -25,6 +25,8 @@
|
|||
#ifndef _CRYPTO_TESTMGR_H
|
||||
#define _CRYPTO_TESTMGR_H
|
||||
|
||||
#include <linux/oid_registry.h>
|
||||
|
||||
#define MAX_IVLEN 32
|
||||
|
||||
/*
|
||||
|
|
@ -135,13 +137,16 @@ struct drbg_testvec {
|
|||
|
||||
struct akcipher_testvec {
|
||||
const unsigned char *key;
|
||||
const unsigned char *params;
|
||||
const unsigned char *m;
|
||||
const unsigned char *c;
|
||||
unsigned int key_len;
|
||||
unsigned int param_len;
|
||||
unsigned int m_size;
|
||||
unsigned int c_size;
|
||||
bool public_key_vec;
|
||||
bool siggen_sigver_test;
|
||||
enum OID algo;
|
||||
};
|
||||
|
||||
struct kpp_testvec {
|
||||
|
|
|
|||
Loading…
Reference in a new issue