Skip to content

Commit 87f92c5

Browse files
authored
Merge pull request #6 from tera-insights/openssl-fips-conditional
Fixes
2 parents 7f35f0e + 1d6ecf0 commit 87f92c5

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

hostname_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ func (c *Certificate) CheckEmail(email string, flags CheckFlags) error {
5959
return ValidationError
6060
}
6161
return errors.New("email validation had an internal failure")
62-
}
62+
}

key_linux.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package openssl
2+
3+
// #include "shim.h"
4+
// #include <openssl/rsa.h>
5+
// #include <openssl/pem.h>
6+
import "C"
7+
8+
import (
9+
"runtime"
10+
)
11+
12+
// GenerateRSAKeyWithExponent generates a new RSA private key.
13+
// GenerateRSAKeyWithExponent generates a new RSA private key.
14+
func GenerateRSAKeyWithExponent(bits int) (PrivateKey, error) {
15+
key := C.evp_rsa_gen(C.uint(bits))
16+
p := &pKey{key: key}
17+
runtime.SetFinalizer(p, freePKey)
18+
return p, nil
19+
}

0 commit comments

Comments
 (0)