Skip to content

Commit eb71f75

Browse files
committed
fix issues with PQC-only build
1 parent 79c19a0 commit eb71f75

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/librepgp/stream-key.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,10 +891,6 @@ pgp_key_pkt_t::parse(pgp_source_t &src)
891891
return RNP_ERROR_BAD_FORMAT;
892892
}
893893

894-
#if defined(ENABLE_CRYPTO_REFRESH)
895-
std::vector<uint8_t> tmpbuf;
896-
#endif
897-
898894
pgp_packet_body_t pkt((pgp_pkt_type_t) atag);
899895
/* Read the packet into memory */
900896
rnp_result_t res = pkt.read(src);

src/librepgp/stream-parse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ encrypted_try_key(pgp_source_encrypted_param_t *param,
16231623
}
16241624
#endif
16251625

1626-
#if defined(ENABLE_CRYPTO_REFRESH)
1626+
#if defined(ENABLE_CRYPTO_REFRESH) || defined(ENABLE_PQC)
16271627
/* If AES is forced then salg must be stored plaintext in material */
16281628
sesskey.salg = encmaterial->salg;
16291629
/* check that AES is used when mandated by the standard */

src/librepgp/stream-write.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ encrypted_add_recipient(rnp_ctx_t & ctx,
617617

618618
/* Encrypt the session key */
619619
rnp::secure_bytes enckey;
620-
#if defined(ENABLE_CRYPTO_REFRESH)
620+
#if defined(ENABLE_CRYPTO_REFRESH) || defined(ENABLE_PQC)
621621
if ((pkey.version == PGP_PKSK_V3) && do_encrypt_pkesk_v3_alg_id(pkey.alg)) {
622622
/* for pre-crypto-refresh algorithms, algorithm ID is part of the session key */
623623
enckey.push_back(pkey.salg);
@@ -644,6 +644,8 @@ encrypted_add_recipient(rnp_ctx_t & ctx,
644644
auto material = pgp::EncMaterial::create(pkey.alg);
645645
#if defined(ENABLE_CRYPTO_REFRESH)
646646
material->version = pkey.version;
647+
#endif
648+
#if defined(ENABLE_PQC) || defined(ENABLE_CRYPTO_REFRESH)
647649
material->salg = pkey.salg;
648650
#endif
649651
if (userkey->alg() == PGP_PKA_ECDH) {

0 commit comments

Comments
 (0)