What version of Go are you using (go version)?
-- go1.12.4
Does this issue reproduce with the latest release?
-- Probably, yes too.
What operating system and processor architecture are you using (go env)?
-- Linux, amd64
What did you do?
Used a test.cer file which contains encoded pkix certificate using GOST 34.10-2001 algorithm
and attempted to extract the name with:
package main
import (
"io"
"os"
dio "custom/package"
)
func main() {
file, err := os.Open("test.cer")
if err != nil {
fmt.Println("file opening error:", err)
return
}
defer file.Close() //nolint:errcheck
data, err := dio.ReadOut(file) // reads out the io.Reader until an error
if err != nil && err != io.EOF {
fmt.Println("file reading error:", err)
return
}
cert, err := x509.ParseCertificate(data)
if err != nil {
fmt.Println("error on parsing:", err)
} else {
fmt.Println(cert.PublicKeyAlgorithm)
}
}
What did you expect to see?
Some name, for example GOST 34.10-2001.
What did you see instead?
0
This issue intentionally repeats closed issue, due to the updates made to the Linux kernel, earlier this year, which included the support for the GOST encryption, which makes the original issue close reason, as stated by the contributor, Adam Langley: not carrying it's weight, ― obsolete, in my opinion.
I suggest that package x509 at very least should support extending the list of the supported algorithms defining a way to extend the x509 package with external packages, the same way image package can be extended. Which essentially means, that the whole crypto package and specifically it's hash sub-package, both need to adopt the same changes.
After all new algorithms are popping out, old become vulnerable and thus obsolete, some countries, e.g. China, India, Israel, Russia, ― are defining cryptography algorithms out of the default, so far, range. In my opinion, packages crypto, crypto/hash and crypto/x509 need to allow the user to extend the usage, allowing other implementations to comply with the unified interface, skipping the necessity to comply only with crypto package by redefining the whole x509 from the scratch.
What version of Go are you using (
go version)?-- go1.12.4
Does this issue reproduce with the latest release?
-- Probably, yes too.
What operating system and processor architecture are you using (
go env)?-- Linux, amd64
What did you do?
Used a
test.cerfile which contains encoded pkix certificate using GOST 34.10-2001 algorithmand attempted to extract the name with:
What did you expect to see?
Some name, for example
GOST 34.10-2001.What did you see instead?
0This issue intentionally repeats closed issue, due to the updates made to the Linux kernel, earlier this year, which included the support for the GOST encryption, which makes the original issue close reason, as stated by the contributor, Adam Langley: not carrying it's weight, ― obsolete, in my opinion.
I suggest that package
x509at very least should support extending the list of the supported algorithms defining a way to extend thex509package with external packages, the same wayimagepackage can be extended. Which essentially means, that the wholecryptopackage and specifically it'shashsub-package, both need to adopt the same changes.After all new algorithms are popping out, old become vulnerable and thus obsolete, some countries, e.g. China, India, Israel, Russia, ― are defining cryptography algorithms out of the default, so far, range. In my opinion, packages
crypto,crypto/hashandcrypto/x509need to allow the user to extend the usage, allowing other implementations to comply with the unified interface, skipping the necessity to comply only withcryptopackage by redefining the wholex509from the scratch.