[Asterisk-code-review] test: Add coverage for res_crypto (asterisk[master])

Philip Prindeville asteriskteam at digium.com
Tue Jul 12 14:54:12 CDT 2022


Attention is currently required from: N A.
Philip Prindeville has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/18532 )

Change subject: test: Add coverage for res_crypto
......................................................................


Patch Set 13:

(5 comments)

Commit Message:

https://gerrit.asterisk.org/c/asterisk/+/18532/comment/eb601b54_eedde290 
PS13, Line 8: 
> What is being tested exactly?
Per the contents to test/res_crypto, we're validating the following functionality:

encrypting a block of data with RSA
decrypting a block of data with RSA
signing a block of data with RSA
verifying a signature with RSA
encrypting a block of data with AES-ECB
encrypting a block of data with AES-ECB

as well as accessing test keys from the keystore.


Patchset:

PS13: 
Addressed all comments


File tests/test_crypto.c:

https://gerrit.asterisk.org/c/asterisk/+/18532/comment/ef391c56_06911382 
PS13, Line 4:  * Copyright (C) 2022, Digium, Inc.
> The copyright is yours, not Digium's.
Done


https://gerrit.asterisk.org/c/asterisk/+/18532/comment/69047e7d_53863c71 
PS13, Line 107: 	strcat(key_dir, "/tests/keys");
> Seems like if getcwd got key_dir filled all the way up, strcat could write past the end. […]
Fixed. Using separate buffer and snprintf() instead.  Wish we had strlcpy() and strlcat().


https://gerrit.asterisk.org/c/asterisk/+/18532/comment/f651bf44_393c65fe 
PS13, Line 118: 	if (key == NULL) {
> could also be !key […]
The codebase seems to use == NULL a lot as well, but I'll change it anyway.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18532
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I0d10e7b41009c5290a4356c6480e636712d5c96d
Gerrit-Change-Number: 18532
Gerrit-PatchSet: 13
Gerrit-Owner: Philip Prindeville <philipp at redfish-solutions.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: N A <mail at interlinked.x10host.com>
Gerrit-Attention: N A <mail at interlinked.x10host.com>
Gerrit-Comment-Date: Tue, 12 Jul 2022 19:54:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220712/e0bdea1d/attachment.html>


More information about the asterisk-code-review mailing list