Code Monkey home page Code Monkey logo

stef / libopaque Goto Github PK

View Code? Open in Web Editor NEW
69.0 10.0 10.0 4.17 MB

c implementation of the OPAQUE protocol with bindings for python, php, ruby, lua, zig, java, erlang, golang, js and SASL.

License: GNU Lesser General Public License v3.0

C 66.87% Makefile 3.41% Python 8.05% M4 0.65% PHP 2.01% JavaScript 10.61% HTML 0.27% Shell 0.06% Ruby 0.43% Lua 0.33% Java 1.62% Erlang 1.17% Go 4.36% Meson 0.19%
libsodium ietf-cfrg opaque password password-ake ake authenticated-key-exchange ruby php javascript

libopaque's Issues

Add JavaScript bindings for libopaque

This repo has Python and PHP bindings. I am working on JavaScript bindings: https://github.com/creemama/libopaque/tree/javascript-bindings .

@stef, what are you thoughts on including the JavaScript bindings in this repository? Should I create a separate libopaque.js repository? As an example, https://github.com/jedisct1/libsodium.js/ is a separate repository for the JavaScript bindings of https://github.com/jedisct1/libsodium . See also https://libsodium.gitbook.io/doc/bindings_for_other_languages .

Just like you created libopaque from libsphinx, are you planning on creating separate repositories for the Python bindings like you did for pwdsphinx? (Someone already has https://pypi.org/project/PyOpaque/ .pwdopaque is still available.)

If you plan on creating separate repositories for the PHP and Python libopaque bindings in the future, then I should create a separate repository for the JavaScript bindings. If not, then having JavaScript bindings here might be useful. On the other hand, having a separate repository for libopaque.js would make it easier for me to maintain.

Alternative location for liboprf

Currently the Makefile allows specifying the location of the headers of OPRF dependency:

libopaque/src/makefile

Lines 24 to 27 in a4209e3

ifdef OPRFHOME
OPRFINCDIR=$(OPRFHOME)
else
OPRFINCDIR=/usr/include/oprf

However, no logic is implemented to locate the corresponding library files - I would assume that if headers are not in system default directories, neither will be the libs.

Solving static linking seems to be an easy extension of LIBS, but somehow dynamic linking gets involved (looking for liboprf.so) and I couldn't resolve this one yet:

gcc -march=native -Wall -O2 -g -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fpic -fstack-clash-protection -fcf-protection=full -Werror=format-security -Werror=implicit-function-declaration -Warray-bounds -fsanitize=bounds -fsanitize-undefined-trap-on-error -fsanitize=bounds -fsanitize-undefined-trap-on-error -Wl,-z,defs -Wl,-z,relro -ftrapv -Wl,-z,noexecstack -std=c99  -Iaux_ -I. -o utils/opaque utils/main.c -L. -lopaque -lsodium
/usr/bin/ld: warning: liboprf.so, needed by ./libopaque.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: ./libopaque.so: undefined reference to `oprf_Unblind'
/usr/bin/ld: ./libopaque.so: undefined reference to `expand_message_xmd'
/usr/bin/ld: ./libopaque.so: undefined reference to `oprf_KeyGen'
/usr/bin/ld: ./libopaque.so: undefined reference to `oprf_Blind'
/usr/bin/ld: ./libopaque.so: undefined reference to `oprf_Finalize'
/usr/bin/ld: ./libopaque.so: undefined reference to `voprf_hash_to_group'
/usr/bin/ld: ./libopaque.so: undefined reference to `oprf_Evaluate'
collect2: error: ld returned 1 exit status
make: *** [makefile:86: utils/opaque] Error 1

Error when run "make" command

image

Hi, I face this issue. I appreciate if anyone can help me resolve. I have already install opaque using pip but it raises an error that they could not find libsodium which explains why I following additional installation instructions in libopaque repo!
Thank you!

Explicitly specify SASL mechanism

It would probably be useful to have a (rough) specification of the SASL mechanism for OPAQUE. I'd like to implement that mechanism in rsasl and for that a specification to be able to throw issues at would be quite useful.

µnit test started failing after 0-ing the size of notpackaged id[US] in unpack

The µnit test started failing at the commit (3ef6a11) that zeroes the size of notpackaged idU and idS in unpack. Running make test produces the following output:

# make test
gcc -march=native -Wall -fPIC -O2 -g -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fpic -fstack-clash-protection -fcf-protection=full -Werror=format-security -Werror=implicit-function-declaration -Wl,-z,defs -Wl,-z,relro -ftrapv -Wl,-z,noexecstack -DTRACE -DNORANDOM -Iaux -o opaque.o -c opaque.c
gcc -shared -fpic -march=native -Wall -fPIC -O2 -g -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fpic -fstack-clash-protection -fcf-protection=full -Werror=format-security -Werror=implicit-function-declaration -Wl,-z,defs -Wl,-z,relro -ftrapv -Wl,-z,noexecstack -DTRACE -DNORANDOM -Iaux -o libopaque.so common.o opaque.o aux/kdf_hkdf_sha256.o -g -lsodium
gcc -march=native -Wall -fPIC -O2 -g -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fpic -fstack-clash-protection -fcf-protection=full -Werror=format-security -Werror=implicit-function-declaration -Wl,-z,defs -Wl,-z,relro -ftrapv -Wl,-z,noexecstack -DTRACE -DNORANDOM -Iaux -o tests/munit-opaque tests/munit/munit.c tests/opaque_munit.c -L. -lopaque -g -lsodium
LD_LIBRARY_PATH=/tmp/src: ./tests/munit-opaque --fatal-failures
Running test suite with seed 0x72d997a2...
/opaque-tests/server-init            
  pw=simple guessable dictionary password, key=some optional key contributed to the opaque protocol, idU=user, idS=server, cfg=, type=[ FAIL  ]
cfg sku: 0, pku:0, pks:1, idu:0, ids:0
sizeof(rec): 235
opaque_CreateRegistrationRequest
h0 1ee5e5acb9423c9df20bd067dcc6f60c420d4a10823dd2dbae2e0d0f6abb45ab4199e871b3ecb2153aaad0bad58d925a476e4fc1716c57b66534bc32ebeee730
H0  e0552efba8fc146b7f95d81e0943d53ca8d7cfe1982192de3863fa41e5afac4e
r 7a3c6282f02d37a05023b60d5428e6cc5961d4c31221937adae0b574e4d07205
alpha ca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b334
opaque_CreateRegistrationResponse
beta  c440f5a5fbb95cca3f08776daaa7752eb971c1313cfd41bf50194a361e756610
p_s  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
P_s  8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
opaque_FinalizeRequest
h0_k  ca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b334
rw0  c41de91fc699261ddf895fb287737fc591197c890822b4f0644e7a1e3b2df9b5
key  f6a278081b8574658e77cf6dcc7f71014fbfa9671ba131176ef0ec7aaf4b811b
plain user rec  0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009bfba09ee3035730bb93f50b37bae049790c32fad374350c9882d871559780a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
SecEnv0  0320008f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
ClrEnv0  
pad  8d8e4d3810ed1e0ba5d4c0b3c8d74f84c3c87f9f83925a2d3a9b3f23fd19e9b27f1692
target  0000000000000000000000000000000000000000000000000000000000000000000000
SecEnv1  0320008f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
ClrEnv1  
envelope auth  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f23008eae4db75028b3bd2af1a2f92d655b6eb5b21156ce10c71041c525f24776d793473ecd0000
auth_key  cb15494ce23e96e4f5038e1ad675fa6b579b90122f7dcbcc1f71623d208a7ccc
auth tag  18fd0545d78b951d6504428b1df70ad361c3c91288f245d1c2e21b996888d62b
envelope  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f23008eae4db75028b3bd2af1a2f92d655b6eb5b21156ce10c71041c525f24776d793473ecd000018fd0545d78b951d6504428b1df70ad361c3c91288f245d1c2e21b996888d62b
export_key  7f0ca90f8121cfdafa2b9ae60553fcad85cdc8b456f3a5a54601787d43a2cb9a
cipher user rec  0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009bfba09ee3035730bb93f50b37bae049790c32fad374350c9882d871559780a000000000000000000000000000000000000000000000000000000000000000067000000
opaque_StoreUserRecord
user rec  7a3c6282f02d37a05023b60d5428e6cc5961d4c31221937adae0b574e4d07205000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f09bfba09ee3035730bb93f50b37bae049790c32fad374350c9882d871559780a8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f67000000
opaque_CreateCredentialRequest
h0 1ee5e5acb9423c9df20bd067dcc6f60c420d4a10823dd2dbae2e0d0f6abb45ab4199e871b3ecb2153aaad0bad58d925a476e4fc1716c57b66534bc32ebeee730
H0  e0552efba8fc146b7f95d81e0943d53ca8d7cfe1982192de3863fa41e5afac4e
r 7a3c6282f02d37a05023b60d5428e6cc5961d4c31221937adae0b574e4d07205
alpha ca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b334
sec  7a3c6282f02d37a05023b60d5428e6cc5961d4c31221937adae0b574e4d072050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
pub  ca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b33400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
sec  7a3c6282f02d37a05023b60d5428e6cc5961d4c31221937adae0b574e4d07205000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1fca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b334240073696d706c6520677565737361626c652064696374696f6e6172792070617373776f7264
pub  ca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b3348f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
opaque_CreateCredentialResponse
session srv pub  ca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b3348f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
session srv rec  7a3c6282f02d37a05023b60d5428e6cc5961d4c31221937adae0b574e4d07205000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f09bfba09ee3035730bb93f50b37bae049790c32fad374350c9882d871559780a
session srv x_s  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
session srv k_s  7a3c6282f02d37a05023b60d5428e6cc5961d4c31221937adae0b574e4d07205
session srv alpha  ca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b334
session srv X_s  8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
calc info
idU  75736572
idS  736572766572
nonceU  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
nonceS  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
rec->p_s  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
x_s  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
rec->P_u  09bfba09ee3035730bb93f50b37bae049790c32fad374350c9882d871559780a
pub->X_u  8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
sec df6baf6f6a43b9744fc5ef9dea1122782f9f696dc4a0d15c03c1787ee6d15e6495f91bd07876eeb7fc9f64e04ec3da1fd67d5a1616b5f3f0393996f44d5d8613df6baf6f6a43b9744fc5ef9dea1122782f9f696dc4a0d15c03c1787ee6d15e64
expanded label: session secret 00204f50415155452073657373696f6e207365637265744c851a2244f2edbb9366017e3c2205aa9199b703decc3d8dbb4cdb0c6e8a972e
transcript:  4c851a2244f2edbb9366017e3c2205aa9199b703decc3d8dbb4cdb0c6e8a972e
expanded label: handshake secret 00204f50415155452068616e647368616b65207365637265744c851a2244f2edbb9366017e3c2205aa9199b703decc3d8dbb4cdb0c6e8a972e
transcript:  4c851a2244f2edbb9366017e3c2205aa9199b703decc3d8dbb4cdb0c6e8a972e
expanded label: server mac 00204f504151554520736572766572206d6163
expanded label: client mac 00204f504151554520636c69656e74206d6163
expanded label: server enc 00204f50415155452073657276657220656e63
expanded label: client enc 00204f504151554520636c69656e7420656e63
keys->sk 2f72d49e5f245cf822b3c4b38298cb10d1c4033643f4b5da8060b990e629243c
keys->km2 651cd62a3dc5b16f6cf747b30da0dc425d7b0e5aae6f1088ff008871978fa605
keys->km3 30c93bcc507b6c8e80549bc0e4a06b9bd9f6e2db416ee57bf82ad8435cb51031
keys->ke2 47ab06ea857a13fe3e7b1c44b64f87d37920151e894eb898d9dc35c2c1b8f865
keys->ke3 e5fc0f7c886327465bd5813a84e521cfef7c6e234d817c7833533af1df3abafa
keys  2f72d49e5f245cf822b3c4b38298cb10d1c4033643f4b5da8060b990e629243c651cd62a3dc5b16f6cf747b30da0dc425d7b0e5aae6f1088ff008871978fa60530c93bcc507b6c8e80549bc0e4a06b9bd9f6e2db416ee57bf82ad8435cb5103147ab06ea857a13fe3e7b1c44b64f87d37920151e894eb898d9dc35c2c1b8f865e5fc0f7c886327465bd5813a84e521cfef7c6e234d817c7833533af1df3abafa
session srv sk  2f72d49e5f245cf822b3c4b38298cb10d1c4033643f4b5da8060b990e629243c
session srv km3  30c93bcc507b6c8e80549bc0e4a06b9bd9f6e2db416ee57bf82ad8435cb51031
xcript_state  0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
oprf1  ca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b334
nonceU  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
epubu  8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
oprf2  c440f5a5fbb95cca3f08776daaa7752eb971c1313cfd41bf50194a361e756610
envu  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f23008eae4db75028b3bd2af1a2f92d655b6eb5b21156ce10c71041c525f24776d793473ecd000018fd0545d78b951d6504428b1df70ad361c3c91288f245d1c2e21b996888d62b
nonceS  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
epubs  8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
no infos
xcript  2622ca4cb4444d6e374b148477775a14c2a48522f65673c338f706f6f491ded3
resp->auth  835b370971fe90ea1b4a2ecd49065e5891fd04ca64d8d9e8ad309923231f5f17
km2  651cd62a3dc5b16f6cf747b30da0dc425d7b0e5aae6f1088ff008871978fa605
session srv auth  835b370971fe90ea1b4a2ecd49065e5891fd04ca64d8d9e8ad309923231f5f17
session srv resp  c440f5a5fbb95cca3f08776daaa7752eb971c1313cfd41bf50194a361e7566108f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f835b370971fe90ea1b4a2ecd49065e5891fd04ca64d8d9e8ad309923231f5f1767000000
opaque_RecoverCredentials
session user finish pw  73696d706c6520677565737361626c652064696374696f6e6172792070617373776f7264
session user finish key  736f6d65206f7074696f6e616c206b657920636f6e747269627574656420746f20746865206f70617175652070726f746f636f6c
session user finish sec  7a3c6282f02d37a05023b60d5428e6cc5961d4c31221937adae0b574e4d07205000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1fca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b3342400
session user finish resp  c440f5a5fbb95cca3f08776daaa7752eb971c1313cfd41bf50194a361e7566108f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f835b370971fe90ea1b4a2ecd49065e5891fd04ca64d8d9e8ad309923231f5f1767000000
session user finish r  7a3c6282f02d37a05023b60d5428e6cc5961d4c31221937adae0b574e4d07205
session user finish r^-1  4cac00d19145d80b89d58dd9b4b67839ae409ef2974df8df31f47e0f3375b002
session user finish beta  c440f5a5fbb95cca3f08776daaa7752eb971c1313cfd41bf50194a361e756610
session user finish h0  ca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b334
session user finish rw0  c41de91fc699261ddf895fb287737fc591197c890822b4f0644e7a1e3b2df9b5
session user finish rw  f6a278081b8574658e77cf6dcc7f71014fbfa9671ba131176ef0ec7aaf4b811b
open envelope  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f23008eae4db75028b3bd2af1a2f92d655b6eb5b21156ce10c71041c525f24776d793473ecd000018fd0545d78b951d6504428b1df70ad361c3c91288f245d1c2e21b996888d62b
envelope auth  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f23008eae4db75028b3bd2af1a2f92d655b6eb5b21156ce10c71041c525f24776d793473ecd0000
auth_key  cb15494ce23e96e4f5038e1ad675fa6b579b90122f7dcbcc1f71623d208a7ccc
auth tag  18fd0545d78b951d6504428b1df70ad361c3c91288f245d1c2e21b996888d62b
SecEnv_len: 35
ClrEnv_len: 0
pad  8d8e4d3810ed1e0ba5d4c0b3c8d74f84c3c87f9f83925a2d3a9b3f23fd19e9b27f1692
SecEnv  0320008f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
ClrEnv  
export_key  7f0ca90f8121cfdafa2b9ae60553fcad85cdc8b456f3a5a54601787d43a2cb9a
unpacked cred  07efe5d6e1393f2808bfa134bd9b6d5d3c255986a60dba4dac02b78cec06aa0c09bfba09ee3035730bb93f50b37bae049790c32fad374350c9882d871559780a8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
calc info
idU  75736572
idS  
nonceU  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
nonceS  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
c->p_u  07efe5d6e1393f2808bfa134bd9b6d5d3c255986a60dba4dac02b78cec06aa0c
sec->x_u  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
c->P_s  8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
sec->X_s  8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
sec df6baf6f6a43b9744fc5ef9dea1122782f9f696dc4a0d15c03c1787ee6d15e6495f91bd07876eeb7fc9f64e04ec3da1fd67d5a1616b5f3f0393996f44d5d8613df6baf6f6a43b9744fc5ef9dea1122782f9f696dc4a0d15c03c1787ee6d15e64
expanded label: session secret 00204f50415155452073657373696f6e2073656372657426ad40127c346104d819b23086cc11cff38ebbaafc332d1223cdac5c4435c232
transcript:  26ad40127c346104d819b23086cc11cff38ebbaafc332d1223cdac5c4435c232
expanded label: handshake secret 00204f50415155452068616e647368616b652073656372657426ad40127c346104d819b23086cc11cff38ebbaafc332d1223cdac5c4435c232
transcript:  26ad40127c346104d819b23086cc11cff38ebbaafc332d1223cdac5c4435c232
expanded label: server mac 00204f504151554520736572766572206d6163
expanded label: client mac 00204f504151554520636c69656e74206d6163
expanded label: server enc 00204f50415155452073657276657220656e63
expanded label: client enc 00204f504151554520636c69656e7420656e63
keys->sk 922a2ef2e666b3dc5935685bcb309d19ae4f85e8002b43bd774c5de7588ce468
keys->km2 6f1daf133036fec1cdaf774b8c0febeeb96394536540ff7ebd88c0faf56b1280
keys->km3 426c156ab2acd60047c0f5854474a3663f434dd8275ad7d7b81ceea9a9230c9a
keys->ke2 ecaf6d4f511c80521d3525a8f3daf4267b5418cc9a6abc0c481d9a1dce032ce0
keys->ke3 6c85fd5324b6d910848cb0e0d7e5826cded5d80d882df33e5f9ab4ffbbf33e0e
keys  922a2ef2e666b3dc5935685bcb309d19ae4f85e8002b43bd774c5de7588ce4686f1daf133036fec1cdaf774b8c0febeeb96394536540ff7ebd88c0faf56b1280426c156ab2acd60047c0f5854474a3663f434dd8275ad7d7b81ceea9a9230c9aecaf6d4f511c80521d3525a8f3daf4267b5418cc9a6abc0c481d9a1dce032ce06c85fd5324b6d910848cb0e0d7e5826cded5d80d882df33e5f9ab4ffbbf33e0e
no xcript_state
oprf1  ca2ef245db1ddc7ca8375aef698e939f9443d810f660de49f4df357302a4b334
nonceU  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
epubu  8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
oprf2  c440f5a5fbb95cca3f08776daaa7752eb971c1313cfd41bf50194a361e756610
envu  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f23008eae4db75028b3bd2af1a2f92d655b6eb5b21156ce10c71041c525f24776d793473ecd000018fd0545d78b951d6504428b1df70ad361c3c91288f245d1c2e21b996888d62b
nonceS  000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
epubs  8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f
no infos
xcript  2622ca4cb4444d6e374b148477775a14c2a48522f65673c338f706f6f491ded3
resp->auth  835b370971fe90ea1b4a2ecd49065e5891fd04ca64d8d9e8ad309923231f5f17
km2  6f1daf133036fec1cdaf774b8c0febeeb96394536540ff7ebd88c0faf56b1280
0 of 1 (0%) tests successful, 0 (0%) test skipped.
make: *** [makefile:30: test] Error 1

This appears to be the code that causes the test to fail:

  if(cfg->idU == NotPackaged) {
    ids->idU_len=0;
  }
  if(cfg->idS == NotPackaged) {
    ids->idU_len=0;
  }

I originally thought that replacing ids->idU_len=0 with ids->idS_len=0 in the cfg->idS == NotPackaged conditional would fix the problem, but it did not.

After commenting out the lines, the test passed again.

I also needed to make this change to the makefile to get tests to work:

 test: tests/opaque-munit$(EXT)
-	LD_PRELOAD=./libopaque.so ./tests/munit-opaque --fatal-failures
+	LD_LIBRARY_PATH=$(shell pwd):$(shell printf %s $$LD_LIBRARY_PATH) ./tests/munit-opaque --fatal-failures

Without this change, I got the following error:

# make test
gcc -march=native -Wall -fPIC -O2 -g -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fpic -fstack-clash-protection -fcf-protection=full -Werror=format-security -Werror=implicit-function-declaration -Wl,-z,defs -Wl,-z,relro -ftrapv -Wl,-z,noexecstack -DTRACE -DNORANDOM -Iaux -o opaque.o -c opaque.c
gcc -shared -fpic -march=native -Wall -fPIC -O2 -g -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fpic -fstack-clash-protection -fcf-protection=full -Werror=format-security -Werror=implicit-function-declaration -Wl,-z,defs -Wl,-z,relro -ftrapv -Wl,-z,noexecstack -DTRACE -DNORANDOM -Iaux -o libopaque.so common.o opaque.o aux/kdf_hkdf_sha256.o -g -lsodium
gcc -march=native -Wall -fPIC -O2 -g -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fpic -fstack-clash-protection -fcf-protection=full -Werror=format-security -Werror=implicit-function-declaration -Wl,-z,defs -Wl,-z,relro -ftrapv -Wl,-z,noexecstack -DTRACE -DNORANDOM -Iaux -o tests/munit-opaque tests/munit/munit.c tests/opaque_munit.c -L. -lopaque -g -lsodium
LD_PRELOAD=./libopaque.so ./tests/munit-opaque --fatal-failures
./tests/munit-opaque: error while loading shared libraries: libopaque.so: cannot open shared object file: No such file or directory
make: *** [makefile:30: test] Error 127

Invalid declaration?

image

I assumed demo/public/libopaque.js wasn't completed, so I copied over the contents of dist/libopaque.js over, and it kind of fixed the error. However, I am unable to test the demo functionality.

image

I am unsure of the contents of libopaque.js (and how to read it) but I am willing to attempt using the this library in my client authentication system. Guidance on where to start would be gladly appreciated.

Change context string of byte type in createcredentialresponse to string type and context string

This is the code for python
resp, _, authU = CreateCredentialResponse(unhexlify(logD.pub), data[0], defineStruct(data[1]), 
            b"pyopaque-v0.2.0-demo")
This is the javascript code
const { authU } = opaque.recoverCredentials({resp, sec, context: "pyopaque-v0.2.0-demo", ids})

Hi @stef , I found out that the context string has to be "pyopaque-v0.2.0-demo" and it has to be of byte type.
My frontend in javascript is having some challenges in recoverCredentials as the authU in server does not match the authU in frontend. I have entered the credentials correctly.
Even if I attempt to change the type of context string in frontend to byte (which js gives bytearray) is still not working.

I strongly hope that the input for context string can be changed to string type as I am having issues (I suppose the byte string in server & normal string in javascript is giving me inconsistent authU)

Look forward to your reply, as I am implementing this in my project.
Thank you.

linker command failed with exit code 1

Hi,

While running the make command I'm getting the following error. Can you please help me resolve this? I am on mac 13.2 with intel processor.

gcc -shared -march=native -Wall -O2 -g -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fpic -fstack-clash-protection -fcf-protection=full -Werror=format-security -Werror=implicit-function-declaration -Wl,-z,defs -Wl,-z,relro -ftrapv -Wl,-z,noexecstack -Iaux_ -Wl,-soname,libopaque.so -o libopaque.so common.o opaque.o aux_/kdf_hkdf_sha512.o -g -lsodium ld: unknown option: -z clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [libopaque.so] Error 1

The password should never be disclosed to the server

Hello.

According to https://github.com/stef/libopaque/blob/master/src/utils/man/opaque.md:

Initializing OPAQUE (registration) can be done either online or offline. The online variant has the benefit that the server never learns anything about the users password, with the drawback that this requires 3 messages to be exchanged by the client and the server.

The offline initialization is much easier, however either the user learns the servers secret, or the server learns the users password. The latter might be useful if some organisation wants to enforce some password quality rules and check those upon registration. The drawback is that either way, some sensitive information leaks to the other party.

This is not supposed to be true.

https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-opaque

OPAQUE provides forward secrecy with respect to password leakage while also hiding the password from the server, even during password registration.

clients never disclose their passwords to the server, even during registration

Some applications may require learning the client's password for enforcing password rules. Doing so invalidates this important security property of OPAQUE and is NOT RECOMMENDED. Applications should move such checks to the client.

[...]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.