summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2013-12-22 17:12:28 +0400
committerWerner Koch <wk@gnupg.org>2014-03-04 11:00:12 +0100
commitea8d597726305274214224757b32730644e12bd8 (patch)
treee416eb64049683d4f54353d30a8649995c28dab1 /src
parent6be3032048ee2466511d2384fcf2d28b856219b2 (diff)
downloadlibgcrypt-ea8d597726305274214224757b32730644e12bd8.tar.gz
Add a simple (raw) PKCS#1 padding mode
* src/cipher.h (PUBKEY_ENC_PKCS1_RAW): New. * cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist): Handle pkcs1-raw flag. * cipher/pubkey-util.c (_gcry_pk_util_data_to_mpi): Handle s-exp like (data (flags pkcs1-raw) (value xxxxx)) * cipher/rsa-common.c (_gcry_rsa_pkcs1_encode_raw_for_sig): PKCS#1-encode data with embedded hash OID for signature verification. * tests/basic.c (check_pubkey_sign): Add tests for s-exps with pkcs1-raw flag. -- Allow user to specify (flags pkcs1-raw) to enable pkcs1 padding of raw value (no hash algorithm is specified). It is up to the user to verify that the passed value is properly formatted and includes DER-encoded ASN OID of the used hash function. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/cipher.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cipher.h b/src/cipher.h
index 10bfe0c5..26ffddc6 100644
--- a/src/cipher.h
+++ b/src/cipher.h
@@ -54,6 +54,7 @@ enum pk_encoding
{
PUBKEY_ENC_RAW,
PUBKEY_ENC_PKCS1,
+ PUBKEY_ENC_PKCS1_RAW,
PUBKEY_ENC_OAEP,
PUBKEY_ENC_PSS,
PUBKEY_ENC_UNKNOWN