Or more correctly stop preventing them from being used. For an EC key the PEM contains -----BEGIN EC PRIVATE KEY----- instead of -----BEGIN PRIVATE KEY----, which wasn't matched by this sanity check. If one wanted to be more specific the -----BEGIN EC PARAMETERS----- section could also be required if EC PRIVATE KEY exists and PRIVATE KEY doesn't, but as this is a trivial sanity check that probably isn't important.
Or more correctly stop preventing them from being used. For an EC key the PEM contains
-----BEGIN EC PRIVATE KEY-----
instead of-----BEGIN PRIVATE KEY----
, which wasn't matched by this sanity check. If one wanted to be more specific the-----BEGIN EC PARAMETERS-----
section could also be required if EC PRIVATE KEY exists and PRIVATE KEY doesn't, but as this is a trivial sanity check that probably isn't important.