#include <linux/slab.h>
 #include <linux/seq_file.h>
 #include <linux/scatterlist.h>
+#include <linux/asn1.h>
 #include <keys/asymmetric-subtype.h>
 #include <crypto/public_key.h>
 #include <crypto/akcipher.h>
                return n >= CRYPTO_MAX_ALG_NAME ? -EINVAL : 0;
        }
 
-       if (strcmp(encoding, "raw") == 0) {
+       if (strcmp(encoding, "raw") == 0 ||
+           strcmp(encoding, "x962") == 0) {
                strcpy(alg_name, pkey->pkey_algo);
                return 0;
        }
 
                ctx->cert->sig->hash_algo = "sha224";
                goto rsa_pkcs1;
 
+       case OID_id_ecdsa_with_sha1:
+               ctx->cert->sig->hash_algo = "sha1";
+               goto ecdsa;
+
+       case OID_id_ecdsa_with_sha224:
+               ctx->cert->sig->hash_algo = "sha224";
+               goto ecdsa;
+
+       case OID_id_ecdsa_with_sha256:
+               ctx->cert->sig->hash_algo = "sha256";
+               goto ecdsa;
+
+       case OID_id_ecdsa_with_sha384:
+               ctx->cert->sig->hash_algo = "sha384";
+               goto ecdsa;
+
+       case OID_id_ecdsa_with_sha512:
+               ctx->cert->sig->hash_algo = "sha512";
+               goto ecdsa;
+
        case OID_gost2012Signature256:
                ctx->cert->sig->hash_algo = "streebog256";
                goto ecrdsa;
        ctx->cert->sig->encoding = "raw";
        ctx->algo_oid = ctx->last_oid;
        return 0;
+ecdsa:
+       ctx->cert->sig->pkey_algo = "ecdsa";
+       ctx->cert->sig->encoding = "x962";
+       ctx->algo_oid = ctx->last_oid;
+       return 0;
 }
 
 /*
 
        if (strcmp(ctx->cert->sig->pkey_algo, "rsa") == 0 ||
            strcmp(ctx->cert->sig->pkey_algo, "ecrdsa") == 0 ||
-           strcmp(ctx->cert->sig->pkey_algo, "sm2") == 0) {
+           strcmp(ctx->cert->sig->pkey_algo, "sm2") == 0 ||
+           strcmp(ctx->cert->sig->pkey_algo, "ecdsa") == 0) {
                /* Discard the BIT STRING metadata */
                if (vlen < 1 || *(const u8 *)value != 0)
                        return -EBADMSG;
                case OID_sm2:
                        ctx->cert->pub->pkey_algo = "sm2";
                        break;
+               case OID_id_prime192v1:
+                       ctx->cert->pub->pkey_algo = "ecdsa-nist-p192";
+                       break;
+               case OID_id_prime256v1:
+                       ctx->cert->pub->pkey_algo = "ecdsa-nist-p256";
+                       break;
                default:
                        return -ENOPKG;
                }
 
        }
 
        ret = -EKEYREJECTED;
-       if (strcmp(cert->pub->pkey_algo, cert->sig->pkey_algo) != 0)
+       if (strcmp(cert->pub->pkey_algo, cert->sig->pkey_algo) != 0 &&
+           (strncmp(cert->pub->pkey_algo, "ecdsa-", 6) != 0 ||
+            strcmp(cert->sig->pkey_algo, "ecdsa") != 0))
                goto out;
 
        ret = public_key_verify_signature(cert->pub, cert->sig);
 
        OID_id_dsa_with_sha1,           /* 1.2.840.10030.4.3 */
        OID_id_dsa,                     /* 1.2.840.10040.4.1 */
        OID_id_ecPublicKey,             /* 1.2.840.10045.2.1 */
+       OID_id_prime192v1,              /* 1.2.840.10045.3.1.1 */
+       OID_id_prime256v1,              /* 1.2.840.10045.3.1.7 */
        OID_id_ecdsa_with_sha1,         /* 1.2.840.10045.4.1 */
        OID_id_ecdsa_with_sha224,       /* 1.2.840.10045.4.3.1 */
        OID_id_ecdsa_with_sha256,       /* 1.2.840.10045.4.3.2 */