diff options
| author | Miloslav Trmač <mitr@redhat.com> | 2010-10-21 21:16:47 +0200 |
|---|---|---|
| committer | Miloslav Trmač <mitr@redhat.com> | 2010-10-21 21:16:47 +0200 |
| commit | 665a66c7f5f4128bac6bcec7f358a5919da3942e (patch) | |
| tree | 7ac73c51f409ebb4a003683266e5c3507f975c30 /lib | |
| parent | 426897c6a16d8633eff925b99ef2990ab4ec355b (diff) | |
Terminate hash input before reading result
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ncrypto_alg.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ncrypto_alg.c b/lib/ncrypto_alg.c index 20ef567..60f3696 100644 --- a/lib/ncrypto_alg.c +++ b/lib/ncrypto_alg.c @@ -213,6 +213,8 @@ ncr_digest_final (struct ncr_digest_session *sess, void *dest, g_return_val_if_fail (dest != NULL, CKR_ARGUMENTS_BAD); + if (write (sess->fd, "", 0) == -1) + return ckr_errno (); res = read (sess->fd, dest, sess->md_size); sess->state = NDS_FINISHED; if (res == sess->md_size) |
