~comcloudway/builds.sr.ht

12000dfa159b0bb6da27ed214fb13c763dea373c — Drew DeVault 5 years ago 3a933a2
Remove PGP validation
1 files changed, 1 insertions(+), 11 deletions(-)

M buildsrht/blueprints/secrets.py
M buildsrht/blueprints/secrets.py => buildsrht/blueprints/secrets.py +1 -11
@@ 2,7 2,6 @@ from flask import Blueprint, render_template, request, redirect, session, abort
from flask_login import current_user
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import pgpy

from srht.database import db
from srht.flask import loginrequired


@@ 60,16 59,7 @@ def secrets_POST():

    secret = Secret(current_user, secret_type)

    if secret_type == SecretType.pgp_key:
        try:
            key, _ = pgpy.PGPKey.from_blob(_secret)
            if key.is_protected:
                valid.error("PGP key cannot be passphrase protected.",
                        field="secret")
        except Exception as ex:
            valid.error("Invalid PGP key.",
                    field="secret")
    elif secret_type == SecretType.plaintext_file:
    if secret_type == SecretType.plaintext_file:
        file_path = valid.require("file-path", friendly_name="Path")
        file_mode = valid.require("file-mode", friendly_name="Mode")
        if not valid.ok: