Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37ff9a33 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Update key gen script

parent c508a182
Loading
Loading
Loading
Loading

src/common.list

0 → 100644
+10 −0
Original line number Diff line number Diff line
releasekey
platform
shared
media
networkstack
nfc
verity
bluetooth
sdk_sandbox
+2 −2
Original line number Diff line number Diff line
@@ -35,12 +35,12 @@ git config --global user.email "$USER_MAIL"
if [ "$SIGN_BUILDS" = true ]; then
  if [ -z "$(ls -A "$KEYS_DIR")" ]; then
    echo ">> [$(date)] SIGN_BUILDS = true but empty \$KEYS_DIR, generating new keys"
    for c in releasekey platform shared media networkstack; do
    for c in $(cat "/root/common.list"); do
      echo ">> [$(date)]  Generating $c..."
      /root/make_key "$KEYS_DIR/$c" "$KEYS_SUBJECT" <<<'' &>/dev/null
    done
  else
    for c in releasekey platform shared media networkstack; do
    for c in $(cat "/root/common.list"); do
      for e in pk8 x509.pem; do
        if [ ! -f "$KEYS_DIR/$c.$e" ]; then
          echo ">> [$(date)] SIGN_BUILDS = true and not empty \$KEYS_DIR, but \"\$KEYS_DIR/$c.$e\" is missing"
+3 −2
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ read -p "Enter password for '$1' (blank for none; password will be visible): " \
  password

if [ "${3}" = "rsa" -o "$#" -eq 2 ]; then
  ( openssl genrsa -f4 2048 | tee ${one} > ${two} ) &
  ( openssl genrsa -f4 4096 | tee ${one} > ${two} ) &
  hash="-sha256"
elif [ "${3}" = "ec" ]; then
  ( openssl ecparam -name prime256v1 -genkey -noout | tee ${one} > ${two} ) &
@@ -69,10 +69,11 @@ if [ "${password}" == "" ]; then
else
  echo "creating ${1}.pk8 with password [${password}]"
  export password
  openssl pkcs8 -in ${one} -topk8 -outform DER -out $1.pk8 \
  openssl pkcs8 -in ${one} -topk8 -v1 PBE-SHA1-3DES -outform DER -out $1.pk8 \
    -passout env:password
  unset password
fi

wait
wait