From 12000dfa159b0bb6da27ed214fb13c763dea373c Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 17 Feb 2019 15:56:07 -0500 Subject: [PATCH] Remove PGP validation --- buildsrht/blueprints/secrets.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/buildsrht/blueprints/secrets.py b/buildsrht/blueprints/secrets.py index f28fe7a..2fab67c 100644 --- a/buildsrht/blueprints/secrets.py +++ b/buildsrht/blueprints/secrets.py @@ -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: -- 2.38.5