Commit graph

10 commits

Author SHA1 Message Date
Mike Kaganski
6eda59123a Proof key: make sure public exponent is exactly 4 bytes
It seems that Poco returns 3-byte public exponent (0x010001) as
3-element vector, and MS CAPI blob must include 4-byte exponent

In Poco code (Crypto/src/RSAKeyImpl.cpp), its convertToByteVec
uses OpenSSL's BN_bn2bin, which returns big-endian byte order
(see OpenSSL's crypto/bn/bn_lib.c). That is returned from Poco's
RSAKey::modulus() and RSAKey::*Exponent() unchanged, so treat
them accordingly.

Change-Id: I37f5fb9a310d42c7f346429c39611b25dd5bba2f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88989
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-19 10:19:55 +01:00
Mike Kaganski
99f0480460 Proof: URI must be absolute and converted to uppercase
Also access token is already passes decoded to GetProofHeaders,
so don't decode it second time.

Change-Id: I7c4404462a9dd9f53e4e82684b1fcae1aeecee73
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88736
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-18 17:30:19 +01:00
Mike Kaganski
25a1d35467 Read proof key from source directory in debug builds
Change-Id: I3de5ec1d6993fdba8430f40c6c93327e90a151c2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88672
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-18 16:29:54 +01:00
Mike Kaganski
2504c88c43 Don't use Poco buffer when creating a proof
I need this to better control the byte order of values in the proof

Change-Id: I8a21c20af4cc3157c893d870f73cc2afa7910ff4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88076
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-02-06 20:21:31 +01:00
Mike Kaganski
aaa9443eae Only warn on absent proof RSA key, don't log error
This reimplements commit bfb16d8831

Change-Id: I834a45ba4fcb939093b179f316176df790926c4e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88096
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2020-02-06 16:05:40 +01:00
Mike Kaganski
bfb16d8831 Turn some errors to warnings, and drop unneeded stderr output
Change-Id: I63de580480f983e8179546fae6217641fa370135
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88088
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2020-02-06 12:36:55 +01:00
Mike Kaganski
0c0510cccf Implement proper proof-key value attribute
Change-Id: I3f2ad960ce6d3dad4d0b064492355b5643f345c8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87148
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-01-21 19:28:32 +01:00
Michael Meeks
5d5fb42715 Typo fix.
Change-Id: I4698a00a8646366bcf30aabd997c31996a58d0e0
2019-12-14 16:19:48 +00:00
Mike Kaganski
c39645bed5 Fix comparison of integer expressions of different signedness
Change-Id: Idcbaf83cb5f953cb725e5b84c27bc00b2fc267d6
Reviewed-on: https://gerrit.libreoffice.org/83475
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-22 13:03:38 +01:00
Mike Kaganski
a986aabeb1 Initial implementation of proof-key
Change-Id: I7ab79218ca2af268dd4573cb64c6353dc71b5f03
Reviewed-on: https://gerrit.libreoffice.org/82232
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-21 12:56:53 +01:00