{"action":"created","issue":{"url":"https://api.github.com/repos/openssl/openssl/issues/7127","repository_url":"https://api.github.com/repos/openssl/openssl","labels_url":"https://api.github.com/repos/openssl/openssl/issues/7127/labels{/name}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/7127/comments","events_url":"https://api.github.com/repos/openssl/openssl/issues/7127/events","html_url":"https://github.com/openssl/openssl/issues/7127","id":357371271,"node_id":"MDU6SXNzdWUzNTczNzEyNzE=","number":7127,"title":"Change in ECDSA PEM read or write behavior starting in 1.0.2p","user":{"login":"jwalch","id":30099734,"node_id":"MDQ6VXNlcjMwMDk5NzM0","avatar_url":"https://avatars0.githubusercontent.com/u/30099734?v=4","gravatar_id":"","url":"https://api.github.com/users/jwalch","html_url":"https://github.com/jwalch","followers_url":"https://api.github.com/users/jwalch/followers","following_url":"https://api.github.com/users/jwalch/following{/other_user}","gists_url":"https://api.github.com/users/jwalch/gists{/gist_id}","starred_url":"https://api.github.com/users/jwalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwalch/subscriptions","organizations_url":"https://api.github.com/users/jwalch/orgs","repos_url":"https://api.github.com/users/jwalch/repos","events_url":"https://api.github.com/users/jwalch/events{/privacy}","received_events_url":"https://api.github.com/users/jwalch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-09-05T19:30:03Z","updated_at":"2018-09-05T21:15:30Z","closed_at":null,"author_association":"NONE","body":"I have a testcase that looks something like this:\r\n\r\n```\r\nOpenSSL_add_all_algorithms();\r\nFIPS_mode_set(1)\r\nEC_KEY *ecdsa_key = EC_KEY_new();\r\nEC_GROUP *ecgroup = EC_GROUP_new_by_curve_name(NID_secp224k1);\r\nTS_ASSERT_EQUALS(1, EC_KEY_set_group(ecdsa_key, ecgroup));\r\nTS_ASSERT_EQUALS(1, EC_KEY_generate_key(ecdsa_key));\r\nBIO *bp_private = BIO_new(BIO_s_mem());\r\nif (!PEM_write_bio_ECPrivateKey(bp_private, ecdsa_key, NULL, NULL, 0, NULL, NULL)) {\r\n    TS_ASSERT(0);\r\n}\r\nEC_KEY *private_key = PEM_read_bio_ECPrivateKey(bp_private, NULL, NULL, NULL);\r\nTS_ASSERT(private_key != NULL);\r\n```\r\n\r\n(I have simplified it a bit from original form. Obviously the TS_ASSERT* macros aren't OpenSSL APIs, but hopefully it is sufficiently obvious what they do.)\r\n\r\nThis testcase passed against 1.0.2o. Against 1.0.2p, the last line fails. I have not yet carefully investigated if the problem is a difference in what is written out (ie, bp_private does not contain what it used to) or a difference in the behavior of the read function. Regardless, I contend this is valid application code (even if those APIs are discouraged in favor of the more general EVP_PKEY ones) and that a change like this should not have occurred in a security patch."},"comment":{"url":"https://api.github.com/repos/openssl/openssl/issues/comments/418884056","html_url":"https://github.com/openssl/openssl/issues/7127#issuecomment-418884056","issue_url":"https://api.github.com/repos/openssl/openssl/issues/7127","id":418884056,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODg4NDA1Ng==","user":{"login":"jwalch","id":30099734,"node_id":"MDQ6VXNlcjMwMDk5NzM0","avatar_url":"https://avatars0.githubusercontent.com/u/30099734?v=4","gravatar_id":"","url":"https://api.github.com/users/jwalch","html_url":"https://github.com/jwalch","followers_url":"https://api.github.com/users/jwalch/followers","following_url":"https://api.github.com/users/jwalch/following{/other_user}","gists_url":"https://api.github.com/users/jwalch/gists{/gist_id}","starred_url":"https://api.github.com/users/jwalch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwalch/subscriptions","organizations_url":"https://api.github.com/users/jwalch/orgs","repos_url":"https://api.github.com/users/jwalch/repos","events_url":"https://api.github.com/users/jwalch/events{/privacy}","received_events_url":"https://api.github.com/users/jwalch/received_events","type":"User","site_admin":false},"created_at":"2018-09-05T21:15:30Z","updated_at":"2018-09-05T21:15:30Z","author_association":"NONE","body":"@romen Yeah, if that line is removed it seems to work fine. I had a non-FIPS testcase for secp192k1 that wasn't impacted already. I doubted it was curve-specific, so just to be sure I did the secp224k1 one with FIPS off as well, now that you mentioned it. (Again, that seems to work fine.)"}}
{"actor":{"display_login":"jwalch"}}