Re: EVP_CipherFinal_ex for snmpd

2016-10-02 Thread Brent Cook
ok

On Sun, Oct 2, 2016 at 12:34 AM, David Gwynne  wrote:

> this gets rid of a linker warning.
>
> the impression i get is that EVP_CipherFinal_ex explicitely does
> not do cleanup of the cipher context thing, while EVP_CipherFinal
> could if it wanted to.
>
> ok?
>
> Index: usm.c
> ===
> RCS file: /cvs/src/usr.sbin/snmpd/usm.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 usm.c
> --- usm.c   16 Jan 2015 00:05:13 -  1.9
> +++ usm.c   2 Oct 2016 05:32:03 -
> @@ -605,7 +605,7 @@ usm_crypt(struct snmp_message *msg, u_ch
> EVP_CIPHER_CTX_set_padding(, 0);
>
> if (EVP_CipherUpdate(, outbuf, , inbuf, inlen) &&
> -   EVP_CipherFinal(, outbuf + len, ))
> +   EVP_CipherFinal_ex(, outbuf + len, ))
> rv = len + len2;
> else
> rv = -1;
>
>


EVP_CipherFinal_ex for snmpd

2016-10-01 Thread David Gwynne
this gets rid of a linker warning.

the impression i get is that EVP_CipherFinal_ex explicitely does
not do cleanup of the cipher context thing, while EVP_CipherFinal
could if it wanted to.

ok?

Index: usm.c
===
RCS file: /cvs/src/usr.sbin/snmpd/usm.c,v
retrieving revision 1.9
diff -u -p -r1.9 usm.c
--- usm.c   16 Jan 2015 00:05:13 -  1.9
+++ usm.c   2 Oct 2016 05:32:03 -
@@ -605,7 +605,7 @@ usm_crypt(struct snmp_message *msg, u_ch
EVP_CIPHER_CTX_set_padding(, 0);
 
if (EVP_CipherUpdate(, outbuf, , inbuf, inlen) &&
-   EVP_CipherFinal(, outbuf + len, ))
+   EVP_CipherFinal_ex(, outbuf + len, ))
rv = len + len2;
else
rv = -1;