Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hash.c: Implement cupsHashData for OpenSSL #764

Closed
wants to merge 1 commit into from

Conversation

zdohnal
Copy link
Member

@zdohnal zdohnal commented Jul 24, 2023

Fixes #762 .

I've tried to compare results with hashes from GNUTLS:

Hashing "Hello world" by GNUTLS by all supported hashes:

Hash: md5
Final hash size: 16
>%�
y�ƛgL��g�,

Hash: sha
Final hash size: 20
{P,:H�`����c��9g?

Hash: sha2-224
Final hash size: 28
�#��w��n���Xd���

Hash: sha2-256
Final hash size: 32
d��

Hash: sha2-384
Final hash size: 48
�Ҙ�6'��Xx�c7��2���&P�諌'�3��ߔ��

Hash: sha2-512
Final hash size: 64
����킗�ۑtbO���i������&

Hash: sha2-512_224
Final hash size: 28
����킗�ۑtbO���i������&

Hash: sha2-512_256
Final hash size: 32
����킗�ۑtbO���i������&

Hashing by OpenSSL (OpenSSL supports those truncated algorithms by default, but it gives a different output...):

Hash: md5
Final hash size: 16
>%�
y�ƛgL��g�,

Hash: sha
Final hash size: 20
{P,:H�`����c��9g?

Hash: sha2-224
Final hash size: 28
�#��w��n���Xd���

Hash: sha2-256
Final hash size: 32
d��

Hash: sha2-384
Final hash size: 48
�Ҙ�6'��Xx�c7��2���&P�諌'�3��ߔ��

Hash: sha2-512
Final hash size: 64
����킗�ۑtbO���i������&

Hash: sha2-512_224
Final hash size: 28
�����g�O�[Y4/QO>F�����

Hash: sha2-512_256
Final hash size: 32
��XrԮ�h;���(�v�6/�Z���K��_

@michaelrsweet WDYT?

Copy link
Member

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was going to copy the code from the libcups repository - some differences from your implementation to ensure version compatibility...

@zdohnal
Copy link
Member Author

zdohnal commented Jul 24, 2023

@michaelrsweet ok, I'll take the fix from libcups without breaking API (without two block hash feature).

@zdohnal
Copy link
Member Author

zdohnal commented Jul 24, 2023

This should be it.

@zdohnal zdohnal closed this Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request to Add OpenSSL Support in "cupsHashData" (cups/hash.c) Function for AirPrint Web UI Interface
2 participants