mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
added anonymous sender key (-A) support
This commit is contained in:
@@ -34,7 +34,7 @@ int main() {
|
||||
|
||||
/* actually encrypt the message, don't sign it
|
||||
Alice is the sender, Bob is the recipient */
|
||||
pcp_encrypt_stream(ptx, clear_in, crypt_out, alice, pubhash, 0);
|
||||
pcp_encrypt_stream(ptx, clear_in, crypt_out, alice, pubhash, 0, 0);
|
||||
|
||||
/* now, print the encrypted result */
|
||||
fprintf(stderr, "Alice encrypted %"FMT_SIZE_T" bytes for Bob:\n", (SIZE_T_CAST)strlen(message));
|
||||
@@ -51,7 +51,7 @@ int main() {
|
||||
pcphash_add(ptx, alicepub, alicepub->type);
|
||||
|
||||
/* try to decrypt the message */
|
||||
if(pcp_decrypt_stream(ptx, crypt_out, clear_out, bob, NULL, 0) == 0)
|
||||
if(pcp_decrypt_stream(ptx, crypt_out, clear_out, bob, NULL, 0, 0) == 0)
|
||||
fatals_ifany(ptx);
|
||||
else {
|
||||
/* and finally print out the decrypted message */
|
||||
|
||||
@@ -182,6 +182,7 @@ temporarily disabled
|
||||
expect = /encrypted/
|
||||
</test>
|
||||
*/
|
||||
|
||||
#
|
||||
# encryption tests
|
||||
<test check-crypto-alicia-2-bobby>
|
||||
@@ -202,12 +203,23 @@ temporarily disabled
|
||||
expect = /${idbobby} - Bobby/
|
||||
</test>
|
||||
|
||||
<test check-crypto-alicia-encrypt-anonymous>
|
||||
cmd = $pcp -V va -e -A -i ${idbobby} -I testmessage -O testencryptedanon -x a
|
||||
expect = /${idbobby} - Bobby/
|
||||
</test>
|
||||
|
||||
# bobbys part
|
||||
<test check-crypto-bobby-import-secret>
|
||||
cmd = $pcp -V vb -K -I key-bobby-sec -x b
|
||||
expect = /${idbobby}/
|
||||
</test>
|
||||
|
||||
<test check-crypto-bobby-decrypt-anonymous>
|
||||
# decrypt anon, without knowing alicias key
|
||||
cmd = $pcp -V vb -d -O testdecryptedanon -I testencryptedanon -x b
|
||||
expect = /successfully/
|
||||
</test>
|
||||
|
||||
<test check-crypto-alicia-import-alicias-key>
|
||||
cmd = $pcp -V vb -K -I key-alicia-pub
|
||||
expect = /${idalicia}/
|
||||
@@ -272,7 +284,7 @@ temporarily disabled
|
||||
|
||||
<test check-vcl-crypto-unencrypted-secret-message>
|
||||
cmd = echo HALLO | $pcp -V vcl -e -O testencrypted -i ${idbobby}
|
||||
expect = /success/
|
||||
expect = /Bobby/
|
||||
</test>
|
||||
|
||||
<test check-vcl-crypto-unencrypted-secret-read>
|
||||
|
||||
Reference in New Issue
Block a user