Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions lib/instance_agent/plugins/codedeploy/deployment_specification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,8 @@ def self.parse(envelope)
case envelope.format
when "PKCS7/JSON"
pkcs7 = OpenSSL::PKCS7.new(envelope.payload)

# The PKCS7_NOCHAIN flag tells OpenSSL to ignore any PKCS7 CA chain that might be attached
# to the message directly and use the certificates from provided one only for validating the.
# signer's certificate.
#
# However, it will allow use the PKCS7 signer certificate provided to validate the signature.
#
# http://www.openssl.org/docs/crypto/PKCS7_verify.html#VERIFY_PROCESS
#
# The ruby wrapper returns true if OpenSSL returns 1
raise "Validation of PKCS7 signed message failed" unless pkcs7.verify([], @cert_store, nil, OpenSSL::PKCS7::NOCHAIN)
pkcs7.verify([], @cert_store, nil, OpenSSL::PKCS7::NOVERIFY)
# NOTE: the pkcs7.data field is only populated AFTER pkcs7.verify() is called!
parse_deployment_spec_data(pkcs7.data)
when "TEXT/JSON"
raise "Unsupported DeploymentSpecification format: #{envelope.format}" unless AWS::CodeDeploy::Local::Deployer.running_as_developer_utility?
Expand Down