{"action":"created","issue":{"url":"https://api.github.com/repos/bitcoin-core/secp256k1/issues/493","repository_url":"https://api.github.com/repos/bitcoin-core/secp256k1","labels_url":"https://api.github.com/repos/bitcoin-core/secp256k1/issues/493/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin-core/secp256k1/issues/493/comments","events_url":"https://api.github.com/repos/bitcoin-core/secp256k1/issues/493/events","html_url":"https://github.com/bitcoin-core/secp256k1/issues/493","id":284672513,"number":493,"title":"PrivateKey parameters and RFC 5915","user":{"login":"richardschneider","id":631061,"avatar_url":"https://avatars2.githubusercontent.com/u/631061?v=4","gravatar_id":"","url":"https://api.github.com/users/richardschneider","html_url":"https://github.com/richardschneider","followers_url":"https://api.github.com/users/richardschneider/followers","following_url":"https://api.github.com/users/richardschneider/following{/other_user}","gists_url":"https://api.github.com/users/richardschneider/gists{/gist_id}","starred_url":"https://api.github.com/users/richardschneider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardschneider/subscriptions","organizations_url":"https://api.github.com/users/richardschneider/orgs","repos_url":"https://api.github.com/users/richardschneider/repos","events_url":"https://api.github.com/users/richardschneider/events{/privacy}","received_events_url":"https://api.github.com/users/richardschneider/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-27T08:16:20Z","updated_at":"2017-12-27T08:18:23Z","closed_at":null,"author_association":"NONE","body":"The `PrivateKey.parameters` produced by `ec_privkey_export_der` currently contain the curve parameters.  According to [RFC 5915](https://tools.ietf.org/html/rfc5915) section 3, it should contain the curve name (OID).\r\n\r\nIs it possible to change this method, or add a `ec_privkey.export_RFC5480`\r\n\r\n> parameters specifies the elliptic curve domain parameters\r\n      associated to the private key.  The type ECParameters is discussed\r\n      in [RFC5480].  As specified in [RFC5480], only the namedCurve\r\n      CHOICE is permitted.  namedCurve is an object identifier that\r\n      fully identifies the required values for a particular set of\r\n      elliptic curve domain parameters.  Though the ASN.1 indicates that\r\n      the parameters field is OPTIONAL, implementations that conform to\r\n      this document MUST always include the parameters field.\r\n\r\n## Expected\r\n```\r\nSEQUENCE(4 elem)\r\n  INTEGER 1\r\n  OCTET STRING(32 byte) FD1DFE200F8133418031877BF9B54A816D9066011C426ACD46E1B8C16863FEA9\r\n  [0](1 elem)\r\n     OBJECT IDENTIFIER 1.3.132.0.10 secp256k1 (SECG (Certicom) named elliptic curve)\r\n  [1](1 elem)\r\n     BIT STRING(264 bit) 0000001110001111011111001101110011101011001100011011010111110010001101…\r\n```\r\n## Actual\r\n```\r\nSEQUENCE(4 elem)\r\n  INTEGER 1\r\n  OCTET STRING(32 byte) FD1DFE200F8133418031877BF9B54A816D9066011C426ACD46E1B8C16863FEA9\r\n  [0](1 elem)\r\n    SEQUENCE(6 elem)\r\n      INTEGER 1\r\n      SEQUENCE(2 elem)\r\n        OBJECT IDENTIFIER 1.2.840.10045.1.1 prime-field (ANSI X9.62 field type)\r\n        INTEGER(256 bit) 1157920892373161954235709850086879078532699846656405640394575840079088…\r\n     SEQUENCE(2 elem) \r\n       OCTET STRING(1 byte) 00\r\n       OCTET STRING(1 byte) 07\r\n     OCTET STRING(33 byte) 0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798\r\n     INTEGER(256 bit) 1157920892373161954235709850086879078528375642790749043826051631415181…\r\n     INTEGER 1\r\n  [1](1 elem)\r\n     BIT STRING(264 bit) 0000001110001111011111001101110011101011001100011011010111110010001101…\r\n```\r\n\r\nThis was first raised in https://github.com/cryptocoinjs/secp256k1-node/issues/123\r\n"},"comment":{"url":"https://api.github.com/repos/bitcoin-core/secp256k1/issues/comments/354073586","html_url":"https://github.com/bitcoin-core/secp256k1/issues/493#issuecomment-354073586","issue_url":"https://api.github.com/repos/bitcoin-core/secp256k1/issues/493","id":354073586,"user":{"login":"sipa","id":548488,"avatar_url":"https://avatars1.githubusercontent.com/u/548488?v=4","gravatar_id":"","url":"https://api.github.com/users/sipa","html_url":"https://github.com/sipa","followers_url":"https://api.github.com/users/sipa/followers","following_url":"https://api.github.com/users/sipa/following{/other_user}","gists_url":"https://api.github.com/users/sipa/gists{/gist_id}","starred_url":"https://api.github.com/users/sipa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sipa/subscriptions","organizations_url":"https://api.github.com/users/sipa/orgs","repos_url":"https://api.github.com/users/sipa/repos","events_url":"https://api.github.com/users/sipa/events{/privacy}","received_events_url":"https://api.github.com/users/sipa/received_events","type":"User","site_admin":false},"created_at":"2017-12-27T08:18:23Z","updated_at":"2017-12-27T08:18:23Z","author_association":"CONTRIBUTOR","body":"Pull requests welcome.\n\nThat function is only provided for backward compatibility with systems that need to interact with OpenSSL, though, and the implementation matches what OpenSSL does (as far as I know)."}}
{"actor":{"display_login":"sipa"}}