Comments (6)
I answer to myself:
In GnuTLS, RSA-PSS signing and verification is available in the 3.6 branch but not in the 3.5 branch
In OpenSSL, RSA-PSS is available in the 1.1.1 branch but not in the 1.1.0 branch
Both versions are still not officially released, and it will take a little bit longer to be available in the distribs, so I guess the better approach is to wait a little bit longer.
Although, if I'm right, the changes would look like:
Include file
// include/jwt.h insert on line 62
JWT_ALG_PS256,
JWT_ALG_PS384,
JWT_ALG_PS512,
GnuTLS
// libjwt/jwt-gnutls.c insert line 150
case JWT_ALG_PS256:
alg = GNUTLS_DIG_SHA256;
pk_alg = GNUTLS_PK_RSA_PSS;
break;
case JWT_ALG_PS384:
alg = GNUTLS_DIG_SHA384;
pk_alg = GNUTLS_PK_RSA_PSS;
break;
case JWT_ALG_PS512:
alg = GNUTLS_DIG_SHA512;
pk_alg = GNUTLS_PK_RSA_PSS;
break;
// And also change the function jwt_verify_sha_pem accordingly
OpenSSL
// libjwt/jwt-openssl.c insert line 198
/* RSA-PSS */
case JWT_ALG_PS256:
alg = EVP_sha256();
type = EVP_PKEY_RSA_PSS;
break;
case JWT_ALG_PS384:
alg = EVP_sha384();
type = EVP_PKEY_RSA_PSS;
break;
case JWT_ALG_PS512:
alg = EVP_sha512();
type = EVP_PKEY_RSA_PSS;
break;
// Make similar inserts in function jwt_verify_sha_pem
from libjwt.
I am able to sign and verify jwt using RSA-PSS algorithm using the GnuTLS backend!
https://github.com/babelouest/libjwt/tree/rsa-pss
(spoiler alert: it's not as easy as I thought in the post above... :p )
Now I need to complete the openssl backend but I'm less fluent in openssl library than in gnutls library.
@benmcollins (and others), if you're willing to help and have time to help on the openssl part, I'd be very grateful :-)
from libjwt.
Since you have test cases, I should be able to get this setup quickly. JWT.io has PS256/384 tests so I can validate against that.
from libjwt.
Thanks, jwt.io was helpful to me too.
I found this SO question that seems helpful to understand rsa-pss sign/verification with libssl: https://stackoverflow.com/questions/44546272/activate-padding-and-salt
Otherwise, the documentation seems very slim...
from libjwt.
@benmcollins , do you want me to open a pull request to your repo, so you can continue from my code in a new branch?
from libjwt.
Completed in current code base.
from libjwt.
Related Issues (20)
- NEWS file? HOT 3
- Compile error in C++ code HOT 3
- jansson.h is missing HOT 4
- Compiling under SSL 3.x triggers warnings. HOT 4
- fatal error: jwt.h: No such file or directory HOT 2
- missing `libjwt-1.15.3.tar.gz` for 1.15.3 release HOT 1
- JWT: jwt_encode_str() function return only three characters. HOT 4
- jwt_decode returns 22 HOT 81
- ./confugre not working HOT 1
- Correct package on Debian 12 HOT 6
- Is 1.16.0 stable? HOT 2
- Upgrade `m4/doxygen.m4` to `ax_prog_doxygen.m4` from GNU Autoconf Archive? HOT 2
- Failed to parse JWT HOT 1
- Error parsing fractional values in JWT exp HOT 3
- Native windows build HOT 1
- finalize mbedTLS support HOT 2
- Building 1.17.0 fails on aarch64
- Plans to upload more recent versions to older distribution repositories HOT 1
- Issue seen while using jwt_decode api HOT 3
- String format is different for a property between jwt_get_grants_json and jwt_get_grant HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libjwt.