mirror of https://github.com/docker/docs.git
Removing debug adding pcs11 to makefiles
Signed-off-by: Diogo Monica <diogo@docker.com> Signed-off-by: David Lawrence <david.lawrence@docker.com> Signed-off-by: Diogo Monica <diogo@docker.com> (github: endophage)
This commit is contained in:
parent
b59225297a
commit
af1bf0c1d5
|
@ -15,6 +15,7 @@ COPY . /go/src/github.com/docker/notary
|
||||||
WORKDIR /go/src/${NOTARYPKG}
|
WORKDIR /go/src/${NOTARYPKG}
|
||||||
|
|
||||||
RUN go install \
|
RUN go install \
|
||||||
|
-tags pkcs11 \
|
||||||
-ldflags "-w -X ${NOTARYPKG}/version.GitCommit=`git rev-parse --short HEAD` -X ${NOTARYPKG}/version.NotaryVersion=`cat NOTARY_VERSION`" \
|
-ldflags "-w -X ${NOTARYPKG}/version.GitCommit=`git rev-parse --short HEAD` -X ${NOTARYPKG}/version.NotaryVersion=`cat NOTARY_VERSION`" \
|
||||||
${NOTARYPKG}/cmd/notary-server
|
${NOTARYPKG}/cmd/notary-server
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ WORKDIR /go/src/${NOTARYPKG}
|
||||||
|
|
||||||
# Install notary-signer
|
# Install notary-signer
|
||||||
RUN go install \
|
RUN go install \
|
||||||
|
-tags pkcs11 \
|
||||||
-ldflags "-w -X ${NOTARYPKG}/version.GitCommit=`git rev-parse --short HEAD` -X ${NOTARYPKG}/version.NotaryVersion=`cat NOTARY_VERSION`" \
|
-ldflags "-w -X ${NOTARYPKG}/version.GitCommit=`git rev-parse --short HEAD` -X ${NOTARYPKG}/version.NotaryVersion=`cat NOTARY_VERSION`" \
|
||||||
${NOTARYPKG}/cmd/notary-signer
|
${NOTARYPKG}/cmd/notary-signer
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,6 @@ func addECDSAKey(ctx *pkcs11.Ctx, session pkcs11.SessionHandle, privKey data.Pri
|
||||||
}
|
}
|
||||||
defer ctx.Logout(session)
|
defer ctx.Logout(session)
|
||||||
|
|
||||||
fmt.Println("Parsing EC private key")
|
|
||||||
// Create an ecdsa.PrivateKey out of the private key bytes
|
// Create an ecdsa.PrivateKey out of the private key bytes
|
||||||
ecdsaPrivKey, err := x509.ParseECPrivateKey(privKey.Private())
|
ecdsaPrivKey, err := x509.ParseECPrivateKey(privKey.Private())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -118,7 +117,6 @@ func addECDSAKey(ctx *pkcs11.Ctx, session pkcs11.SessionHandle, privKey data.Pri
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create the certificate: %v", err)
|
return fmt.Errorf("failed to create the certificate: %v", err)
|
||||||
}
|
}
|
||||||
fmt.Println("Got a certificate!")
|
|
||||||
|
|
||||||
certTemplate := []*pkcs11.Attribute{
|
certTemplate := []*pkcs11.Attribute{
|
||||||
pkcs11.NewAttribute(pkcs11.CKA_CLASS, pkcs11.CKO_CERTIFICATE),
|
pkcs11.NewAttribute(pkcs11.CKA_CLASS, pkcs11.CKO_CERTIFICATE),
|
||||||
|
@ -138,14 +136,11 @@ func addECDSAKey(ctx *pkcs11.Ctx, session pkcs11.SessionHandle, privKey data.Pri
|
||||||
pkcs11.NewAttribute(pkcs11.CKA_VENDOR_DEFINED, 3),
|
pkcs11.NewAttribute(pkcs11.CKA_VENDOR_DEFINED, 3),
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("About to import the certificate")
|
|
||||||
|
|
||||||
_, err = ctx.CreateObject(session, certTemplate)
|
_, err = ctx.CreateObject(session, certTemplate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error importing: %v", err)
|
return fmt.Errorf("error importing: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("About to import the private key")
|
|
||||||
_, err = ctx.CreateObject(session, privateKeyTemplate)
|
_, err = ctx.CreateObject(session, privateKeyTemplate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error importing: %v", err)
|
return fmt.Errorf("error importing: %v", err)
|
||||||
|
@ -340,7 +335,6 @@ func (s *YubiKeyStore) ImportKey(pemBytes []byte, keyID string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func cleanup(ctx *pkcs11.Ctx, session pkcs11.SessionHandle) {
|
func cleanup(ctx *pkcs11.Ctx, session pkcs11.SessionHandle) {
|
||||||
fmt.Println("Tearing down yubikey session")
|
|
||||||
ctx.CloseSession(session)
|
ctx.CloseSession(session)
|
||||||
ctx.Finalize()
|
ctx.Finalize()
|
||||||
ctx.Destroy()
|
ctx.Destroy()
|
||||||
|
@ -348,7 +342,6 @@ func cleanup(ctx *pkcs11.Ctx, session pkcs11.SessionHandle) {
|
||||||
|
|
||||||
// SetupHSMEnv is a method that depends on the existences
|
// SetupHSMEnv is a method that depends on the existences
|
||||||
func SetupHSMEnv(libraryPath string) (*pkcs11.Ctx, pkcs11.SessionHandle, error) {
|
func SetupHSMEnv(libraryPath string) (*pkcs11.Ctx, pkcs11.SessionHandle, error) {
|
||||||
fmt.Println("Setting up Yubikey")
|
|
||||||
p := pkcs11.New(libraryPath)
|
p := pkcs11.New(libraryPath)
|
||||||
|
|
||||||
if p == nil {
|
if p == nil {
|
||||||
|
|
Loading…
Reference in New Issue