1
0

jose-jwe-dec 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/sh -ex
  2. prfx=$VECTORS/rfc7520_5
  3. test "`jose jwe dec -i $prfx.1.jwec -k $prfx.1.jwk`" = "`cat $prfx.1.pt`"
  4. test "`jose jwe dec -i $prfx.1.jwef -k $prfx.1.jwk`" = "`cat $prfx.1.pt`"
  5. test "`jose jwe dec -i $prfx.1.jweg -k $prfx.1.jwk`" = "`cat $prfx.1.pt`"
  6. if jose alg | grep -q OAEP; then
  7. test "`jose jwe dec -i $prfx.2.jwec -k $prfx.2.jwk`" = "`cat $prfx.2.pt`"
  8. test "`jose jwe dec -i $prfx.2.jwef -k $prfx.2.jwk`" = "`cat $prfx.2.pt`"
  9. test "`jose jwe dec -i $prfx.2.jweg -k $prfx.2.jwk`" = "`cat $prfx.2.pt`"
  10. fi
  11. test "`jose jwe dec -i $prfx.3.jwec -k $prfx.3.pwd`" = "`cat $prfx.3.pt`"
  12. test "`jose jwe dec -i $prfx.3.jwef -k $prfx.3.pwd`" = "`cat $prfx.3.pt`"
  13. test "`jose jwe dec -i $prfx.3.jweg -k $prfx.3.pwd`" = "`cat $prfx.3.pt`"
  14. test "`jose jwe dec -i $prfx.3.jwec -k $prfx.3.jwk`" = "`cat $prfx.3.pt`"
  15. test "`jose jwe dec -i $prfx.3.jwef -k $prfx.3.jwk`" = "`cat $prfx.3.pt`"
  16. test "`jose jwe dec -i $prfx.3.jweg -k $prfx.3.jwk`" = "`cat $prfx.3.pt`"
  17. test "`jose jwe dec -i $prfx.4.jwec -k $prfx.4.jwk`" = "`cat $prfx.4.pt`"
  18. test "`jose jwe dec -i $prfx.4.jwef -k $prfx.4.jwk`" = "`cat $prfx.4.pt`"
  19. test "`jose jwe dec -i $prfx.4.jweg -k $prfx.4.jwk`" = "`cat $prfx.4.pt`"
  20. test "`jose jwe dec -i $prfx.5.jwec -k $prfx.5.jwk`" = "`cat $prfx.5.pt`"
  21. test "`jose jwe dec -i $prfx.5.jweg -k $prfx.5.jwk`" = "`cat $prfx.5.pt`"
  22. test "`jose jwe dec -i $prfx.6.jwec -k $prfx.6.jwk`" = "`cat $prfx.6.pt`"
  23. test "`jose jwe dec -i $prfx.6.jweg -k $prfx.6.jwk`" = "`cat $prfx.6.pt`"
  24. test "`jose jwe dec -i $prfx.7.jwec -k $prfx.7.jwk`" = "`cat $prfx.7.pt`"
  25. test "`jose jwe dec -i $prfx.7.jwef -k $prfx.7.jwk`" = "`cat $prfx.7.pt`"
  26. test "`jose jwe dec -i $prfx.7.jweg -k $prfx.7.jwk`" = "`cat $prfx.7.pt`"
  27. test "`jose jwe dec -i $prfx.8.jwec -k $prfx.8.jwk`" = "`cat $prfx.8.pt`"
  28. test "`jose jwe dec -i $prfx.8.jwef -k $prfx.8.jwk`" = "`cat $prfx.8.pt`"
  29. test "`jose jwe dec -i $prfx.8.jweg -k $prfx.8.jwk`" = "`cat $prfx.8.pt`"
  30. test "`jose jwe dec -i $prfx.9.jwec -k $prfx.9.jwk`" = "`cat $prfx.9.pt`"
  31. test "`jose jwe dec -i $prfx.9.jwef -k $prfx.9.jwk`" = "`cat $prfx.9.pt`"
  32. test "`jose jwe dec -i $prfx.9.jweg -k $prfx.9.jwk`" = "`cat $prfx.9.pt`"
  33. test "`jose jwe dec -i $prfx.10.jwef -k $prfx.10.jwk`" = "`cat $prfx.10.pt`"
  34. test "`jose jwe dec -i $prfx.10.jweg -k $prfx.10.jwk`" = "`cat $prfx.10.pt`"
  35. test "`jose jwe dec -i $prfx.11.jwef -k $prfx.11.jwk`" = "`cat $prfx.11.pt`"
  36. test "`jose jwe dec -i $prfx.11.jweg -k $prfx.11.jwk`" = "`cat $prfx.11.pt`"
  37. test "`jose jwe dec -i $prfx.12.jwef -k $prfx.12.jwk`" = "`cat $prfx.12.pt`"
  38. test "`jose jwe dec -i $prfx.12.jweg -k $prfx.12.jwk`" = "`cat $prfx.12.pt`"
  39. test "`jose jwe dec -i $prfx.13.jweg -k $prfx.13.1.jwk`" = "`cat $prfx.13.pt`"
  40. test "`jose jwe dec -i $prfx.13.jweg -k $prfx.13.2.jwk`" = "`cat $prfx.13.pt`"
  41. test "`jose jwe dec -i $prfx.13.jweg -k $prfx.13.3.jwk`" = "`cat $prfx.13.pt`"
  42. # CVE-2023-50967 - test originally from https://github.com/P3ngu1nW/CVE_Request/blob/main/latch-jose.md
  43. # This test is expected to fail quickly on patched systems.
  44. prfx="${CVE_2023_50967}/cve-2023-50967"
  45. ! test "$(jose jwe dec -i $prfx.jwe -k $prfx.jwk)"