Skip to content

Commit d35f42c

Browse files
Elvira Khabirovajarkkojs
authored andcommitted
pkcs7: support EC-RDSA/streebog in SignerInfo
Allow using EC-RDSA/streebog in pkcs7 certificates in a similar way to how it's done in the x509 parser. This is needed e.g. for loading kernel modules signed with EC-RDSA. Signed-off-by: Elvira Khabirova <[email protected]> Reviewed-by: Vitaly Chikunov <[email protected]> Reviewed-by: Tianjia Zhang <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 3fb8e3f commit d35f42c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

crypto/asymmetric_keys/pkcs7_parser.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ int pkcs7_sig_note_digest_algo(void *context, size_t hdrlen,
251251
case OID_sm3:
252252
ctx->sinfo->sig->hash_algo = "sm3";
253253
break;
254+
case OID_gost2012Digest256:
255+
ctx->sinfo->sig->hash_algo = "streebog256";
256+
break;
257+
case OID_gost2012Digest512:
258+
ctx->sinfo->sig->hash_algo = "streebog512";
259+
break;
254260
default:
255261
printk("Unsupported digest algo: %u\n", ctx->last_oid);
256262
return -ENOPKG;
@@ -284,6 +290,11 @@ int pkcs7_sig_note_pkey_algo(void *context, size_t hdrlen,
284290
ctx->sinfo->sig->pkey_algo = "sm2";
285291
ctx->sinfo->sig->encoding = "raw";
286292
break;
293+
case OID_gost2012PKey256:
294+
case OID_gost2012PKey512:
295+
ctx->sinfo->sig->pkey_algo = "ecrdsa";
296+
ctx->sinfo->sig->encoding = "raw";
297+
break;
287298
default:
288299
printk("Unsupported pkey algo: %u\n", ctx->last_oid);
289300
return -ENOPKG;

0 commit comments

Comments
 (0)