Skip to content

Commit 777700c

Browse files
author
Lauris Kaplinski
committed
Removed some extra check from parsing
1 parent 0854344 commit 777700c

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

cdoc/CDoc2Reader.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -539,29 +539,21 @@ CDoc2Reader::Private::buildLock(Lock& lock, const cdoc20::header::RecipientRecor
539539
}
540540
lock.pk_type = Lock::PKType::ECC;
541541
lock.setBytes(Lock::Params::RCPT_KEY, toUint8Vector(eccDetails->recipient_public_key()));
542-
} else {
543-
LOG_ERROR("Invalid file format");
544-
return;
545542
}
546543
break;
547544
case KeyDetailsUnion::RsaKeyDetails:
548545
if(const RsaKeyDetails *rsaDetails = server->recipient_key_details_as_RsaKeyDetails()) {
549546
lock.pk_type = Lock::PKType::RSA;
550547
lock.setBytes(Lock::Params::RCPT_KEY, toUint8Vector(rsaDetails->recipient_public_key()));
551-
} else {
552-
LOG_ERROR("Invalid file format");
553-
return;
554548
}
555549
break;
556550
default:
557-
LOG_ERROR("Unsupported Key Server Details: skipping");
551+
LOG_ERROR("Unsupported Key Server Details");
558552
return;
559553
}
560554
lock.type = Lock::Type::SERVER;
561555
lock.setString(Lock::Params::KEYSERVER_ID, server->keyserver_id()->str());
562556
lock.setString(Lock::Params::TRANSACTION_ID, server->transaction_id()->str());
563-
} else {
564-
LOG_ERROR("Invalid file format");
565557
}
566558
return;
567559
case Capsule::recipients_SymmetricKeyCapsule:
@@ -616,7 +608,7 @@ CDoc2Reader::Private::buildLock(Lock& lock, const cdoc20::header::RecipientRecor
616608
}
617609
return;
618610
default:
619-
LOG_ERROR("Unsupported Key Details: skipping");
611+
LOG_ERROR("Unsupported capsule type");
620612
}
621613
}
622614

0 commit comments

Comments
 (0)