Sha256: fb2707719c3adc70b73b7c6fe70805ca919c0640fd340f3ba45f17609308277a

Contents?: true

Size: 499 Bytes

Versions: 2

Compression:

Stored size: 499 Bytes

Contents

#! /bin/bash

csr=`cat`

csr_text=$(echo "$csr" | openssl req -noout -text)
certname=$1

# The challenge password for each node should be:
# the sha512sum of the hostname with a salt of
# "securityishard" appended to the end.

salt=`date +"%Y%m%d%H%M"`

# Calculate the expected sha512sum
# This is complex because we have to cut some trailing whitespace off
expected_sum=$(echo "$certname$salt" | sha512sum | rev | cut -c 4- | rev)

if [[ $csr_text == *"$expected_sum"* ]]
then
  exit 0
fi

exit 1

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
onceover-4.0.0 spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/autosign.sh
onceover-3.22.0 spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/autosign.sh